Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how to set a variable as undefined

492 views
Skip to first unread message

Sharad Singh

unread,
Aug 12, 2009, 2:36:27 AM8/12/09
to
Hi ,

I am using tracemonkey and want to set a variable as undefined using
the following script :

var a;

After this script is evaluated , when I check the value of variable a
by JS_ExecuteScript , I get the value as -121212 (some garbage)
instead of undefined.

The same works perfectly well with spidermonkey. Is there any
difference in the implementation of undefined variables in
spidermonkey and tracemonkey. Or am I missing something here?

Regards,
Sharad kumar singh

Martín Marqués

unread,
Aug 26, 2009, 3:22:08 PM8/26/09
to Sharad Singh, dev-tech-...@lists.mozilla.org
El 12/08/09 03:36, Sharad Singh escribió:

> Hi ,
>
> I am using tracemonkey and want to set a variable as undefined using
> the following script :
>
> var a;
>
> After this script is evaluated , when I check the value of variable a
> by JS_ExecuteScript , I get the value as -121212 (some garbage)
> instead of undefined.

Shouldn't this work?

a=undefined

0 new messages