I need more readings and/or examples on how to use ScopeChain spidermonkey 60

any help would be appreciated
0
msami
4/7/2019 8:59:37 AM
mozilla.dev.tech.js-engine 2032 articles. 0 followers. Post Follow

5 Replies
17 Views

Similar Articles

[PageSpeed] 2

for more details I need to execute javascript on multi level scope one of the ideas is to use scope chain 

  
0
msami
4/7/2019 10:06:44 AM
On Sunday, April 7, 2019 at 10:59:38 AM UTC+2, msami wrote:
> any help would be appreciated

this is the method I need to use but 

bool
JS::Evaluate(JSContext *cx, JS::AutoObjectVector &scopeChain,
             const ReadOnlyCompileOptions &options,
             const char16_t *chars, size_t length, JS::MutableHandleValue rval);
0
msami
4/7/2019 10:07:53 AM
On Sunday, April 7, 2019 at 12:06:46 PM UTC+2, msami wrote:
> for more details I need to execute javascript on multi level scope one of the ideas is to use scope chain

this is the method I intend to use
bool
JS::Evaluate(JSContext *cx, JS::AutoObjectVector &scopeChain,
             const ReadOnlyCompileOptions &options,
             const char16_t *chars, size_t length, JS::MutableHandleValue rval);
0
msami
4/7/2019 10:09:13 AM
On 4/7/19 4:59 AM, msami wrote:
> any help would be appreciated

Have you already looked at the existing uses in Firefox?

In particular, 
https://searchfox.org/mozilla-central/source/js/src/jsapi-tests/testJSEvaluateScript.cpp 
has a pretty minimal usage example.  The API is a bit different from the 
one in 60, but I think 
https://searchfox.org/mozilla-central/rev/a6587cb8740141701449911468fcb4434952c46f/js/src/jsapi-tests/testJSEvaluateScript.cpp 
should be the API you're looking for.

-Boris
0
Boris
4/7/2019 4:09:18 PM
Thank you, Boris, that was very useful.
0
msami
4/8/2019 8:29:24 AM
Reply: