Subj : ReferenceError problem resurfaces ?? or scope chain incorrect?? To : netscape.public.mozilla.jseng From : Jaspreet Date : Tue Apr 19 2005 11:43 am Hi, I am building the JS Engine (and also my application ) with /OPT:NOICF linker option, however i am still getting the ReferenceError problem. I am trying to implement a scoping mechanism with lets say 3 levels, session, document, dialog. 'document' is an object created under 'session' and 'dialog' is an object created under 'document' To create a variable 'status' under 'session' this is what i do: // curScopeObj points to 'session' obj tmp = JS_NewObject(cx, &some_class, NULL, curScopeObj); JS_EvaluateScript(cx, curScopeObj, "true", 4, ....,&rval); JS_DefineProperty(cx, curScopeObj, "status", OBJECT_TO_JSVAL(tmp), NULL, NULL, JSPROP_ENUMERATE|JSPROP_PERMANENT); To access 'status' at a later point (when curScopeObj is pointing to 'dialog' : JS_EvaluateScript(cx, curScopeObj, "status == true ;".... &rval) at this point i get an error "ReferenceError: status is not defined" As far as see, i have defined the parent of dialog to document and that of document to session.. that should establish the scope chain. However i am unsure if this is the right way (and the only thing required to set it up ) Any help is sorting this out is really appreciated. Regards Jaspreet .