MozillaZine

SpiderMonkey : how to access value of var in js from c ?

Discuss building things with or for the Mozilla Platform.
mozillazineuser22
 
Posts: 39
Joined: April 30th, 2008, 9:01 am

Post Posted May 23rd, 2013, 12:39 am

Hi,

I would like to know how can I access a value of var in js from c.
So far what I done is using, in this order, and this it works fine:
Code: Select all
...
JS_CompileScript
JS_ExecuteScript
JS_CallFunctionName
....


Now I want to add that before I call the JS_ExecuteScript, I want to check if there is a certain var which was defined in the js file, and what is the value.
e.g:
Before I call JS_CallFunctionName("foo"), I want to check what is the value of abc.
Code: Select all
var abc=123;
function foo(){
}


Thanks for your help.
Si.

Return to Mozilla Development


Who is online

Users browsing this forum: No registered users and 2 guests