Subj : Re: [SpiderMonkey] JS_DefineObject returns null after moving to newest sources To : Brendan Eich From : ggadwa@voyager.net (Brian Barnes) Date : Sat Jul 19 2003 05:24 am On Friday, July 18, 2003, at 04:32 PM, Brendan Eich wrote: > Brian Barnes wrote: > >> parent_obj and cx are both valid, and other calls work for them (as >> does the 1.4 spidermonkey engine.) Yes, I know this is little >> information, but does anything changed between those versions spring >> to mind that might cause JS_DefineObject to fail? > > No. > > You need to debug. Also, do you set an error reporter? If not, you > should (and then say what error is being reported). It's not throwing an error (should have mentioned that), but I figured out what it is. This is behavior I depended on in 1.4 to make objects you couldn't add properties to, so if you had mistyped the name of a property you'd get a error instead of adding a new property. I did this by hooking up a resolving function, i.e.: JSClass dim3_class={"dim3_class",JSCLASS_HAS_PRIVATE, JS_PropertyStub,JS_PropertyStub,JS_PropertyStub,JS_PropertyStub, JS_EnumerateStub,scripts_resolve_object,JS_ConvertStub,JS_FinalizeStub}; scripts_resolve_object just always threw an error, but for me, every ambiguous property was an error. Before it wasn't getting called on JS_DefineObject, but now it is. So I have to think of some other way around this -- I probably shouldn't have depended on this, anyway. I get the idea my little hack work isn't the proper way to do this :) [>] Brian .