spidermonkey

javascript - catch SyntaxError and run alternate function

Hello there, I'm trying to build something on javascript that I can have an input that can be everything like string, xml, javascript and (non-javascript string without quotes) as follows: //strings eval("'hello I am a string'"); /* note the following proper quote marks */ //xml eval(<p>Hello I am a XML doc</p>); //javascri...

Where Do I Download TraceMonkey?

I can get the Spidermonkey javascript engine from here: http://www.mozilla.org/js/spidermonkey/ And, I know that Tracemonkey is the newer version released after SpiderMonkey but I cannot find the download link for it in Mozilla? Is it released for public use? Should I stick back to SpiderMonkey or switch to Google's V8 altogether - i...

TraceMonkey and GNU GPL license

I am trying to embed a Javascript engine into my application. But the license for Mozilla Javascript engine is GNU/GPL/MPL based and I don't have the time and energy to digest the cryptic legal document. In short, does the license mean I need to publish my application's source code if I embed the engine into my own appli.? Something I...

How to get Xcode 3.2.3 to correctly include the SpiderMonkey jsapi.h file?

I have created a C Command Line app in Xcode 3.2.3. I have compiled SpiderMonkey from the command line, and have it working, this was for CouchDB 0.11. The js interpreter works, as well as all the files being in /usr/local/spidermonkey/include and /usr/local/spidermonkey/lib. I have added /usr/local/spidermonkey/include to my Header Pat...

Embedding SpiderMonkey in a portable C app.

Hi folks, I'd like to embed Mozilla's SpiderMonkey in one of my C apps. On linux, I don't think it'll be a problem (I'm a linux user) but I must confess that I'm afraid that I have no clue on how to do it on windows using MINGW (I want the app to be portable) Is it possible to, say, just use the dll that comes with firefox? (I, honnest...

How to inherit a C++ class in JavaScript?

I am embedding SpiderMonkey to make my C++ library scriptable. To make it extendable, I need it possible to define a new class (JavaScript) inheriting one C++ base class of the library. Is there an example showing me how to do that using SpiderMonkey? ...

How to read the content from a (local) file with SpiderMonkey on the command line?

I want to use SpiderMonkey for driving a test harness (for the in-browser version see here). Now, I tried the following: var defaultFileName = "all.n3"; var reader = new FileReader(); reader.readAsText(defaultFileName); reader.onload = fileLoaded; which fails with the following error: regression-tests.js:9: ReferenceError: FileReader...

rhino vs spidermonkey

I noticed ubuntu 10.04 removed the spidermonkey package. Rhino looks like it's still there though. What are the differences between rhino and spidermonkey (besides what language they're written in). And why did they remove spidermonkey? ...

C++ Object & Javascript Object life cycle mis-synchronization

Dear all, I got a question regarding C++ Object & Javascript Object life cycle mis-synchronization and hope here your gurus could help me out. Specifically, I am embedding SpiderMonkey in my C++ program. I am not sure if my approach is right or not. What I am doing is like (1) C++ program loads a Javascript file and call an entry fun...

SpiderMonkey: How do i get the name of the current JSObject from c?

Hello, someone asked how to get the value of a JSObject property from c. That helped me a bit. But, does anyone know how to get the current JavaScript name of an object from c? example: var foo={prop:'bar'}; then somewhere for example in jsapi.cpp: JS_somemethod(JSContext *cx, JSObject *obj){ //how do i get the name 'foo' (or the...

Test for functions names in javascript script (SpiderMonkey engine)

I am embeding SpiderMonkey (mozila javascript) interpreter/engine in my C/C++ application. i programatically loading a javascript script and want to test (from my C/C++ code) if a certain function exist/defined in this script. is there a way to do that ? maybe a way to list all functions in a given script ? Tnx, Vertilka ...