Subj : Re: Another JS question To : netscape.public.mozilla.jseng From : Sterling Bates Date : Tue May 04 2004 12:49 pm Brendan Eich wrote: > Yes, the ECMA spec came after the JS implementation that evolved into > SpiderMonkey, and one of the quirks of the JS_ValueToObject API is that > it treats null and undefined as objects, return NULL in *objp. > > This should be called out in the API docs. If people need it, we could > add a thin JS_ValueToNonNullObject. Sounds good, how about adding this to the end of JS_ValueToObject's current description: "If v is NULL or void, JS_ValueToObject assigns NULL to objp and returns JS_TRUE. This is a known departure from the ECMA 262-3 specification, which was written after SpiderMonkey. Developers who require ECMA 262-3 compliance may raise the issue in n.p.m.jseng." (Proper notation excluded for readability.) Just as a question: would it work if js_ValueToObject checked JSVERSION_IS_ECMA first, and was dynamically compliant vs traditional? Sterling .