I saw example code on spider monkey site , JS_EvaluateScript always refer to global scope object , If I would like to create scope object which the parent is global scope , this will work ?
JS_EvaluateScript (cx , scope_obj, ... )
scope_1 ----has -- global object as parent
scope_2 ----has -- global object as parent as well
When I run
JS_EvaluateScript(cx , scope_1 , "var scope1var = 'hello'"....)
it's fine...
And Then I run
JS_EvaluateScript(cx , scope_2 , "scope1var +' world'"....)
it should has error because scope_2 doesn't have variable of scope_1.
but the result return as " hello world"
Please advise if I miss anything , sir
============================
Or could you please tell me how to implement when code is entering new scope ? Thank you.