I am using the latest release of SpiderMonkey (js185-1.0.0.tar.gz) and when I am running the sample program which embeds Javascript, crashes the program
The sample program is directly from the docs
The program runs fine if I am using JS_NewCompartmentAndGlobalObject but the docs mention to use JS_NewGlobalObject as it is "Obsolete since JSAPI 16"
Hence I replaced the JS_NewCompartmentAndGlobalObject
with JS_NewGlobalObject
and since then the sample program crashes at line: 55 in the sample program found here
What is the solution here?
I am using CentOS 6.2 64-bit version.
The deprecation is likely related to the recent change to how compartments are created in SM (now every new global will get its own compartment by default).
You should be using JS_NewCompartmentAndGlobalObject, as that function was only deprecated in JSAPI 16, 72 weeks after JS 1.8.5 was released :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With