On Jun 18, 4:57 pm, Mike Tardif <[EMAIL PROTECTED]> wrote:
> Hi Again
>
> I've exposed my objects (whose properties are dynamic) to JavaScript
> by deriving from ScriptableObject and generally all is good.
>
> But I've failed to properly deal with this JavaScript scenario:
> try {
> myObject.notMyProperty = "hello"
> }
> catch(e) {
> "unrecognized property"
> }
> "hello world"
>
> My question is: in myObject's put(String, Scriptable, Object) method,
> what kind of RhinoException do I throw when myObject recognizes that
> notMyProperty is invalid, so that catch block in the above script gets
> executed as well as any code that follows.
>
> I wish the docs for Scriptable and/or ScriptableObject would expand a
> bit more on exception handling.
Standard JavaScript behavior is that assignment to an undefined
property results in creation of the property. That means that I didn't
define a standard exception for failures. What kind of failure are you
wanting to throw an exception for?
--Norris
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino