I want to embed Mozilla's SpiderMonkey in my standalone C++ program (in Visual Studio 2019). I went over all the documentation and whatnot but the problem is (or what I need is):
- Execute a JavaScript script through C++. In pseudo code that'd be
Value* result = SpiderMonkeyEvaluate(fileString);
And that's it. The thing is, in the documentation it says I need to build the entirety of Mozilla's Firefox browser (which is not less than a Gigabyte) and download Mercurial and open the command prompt and create directories etc. and all that disgusting stuff. I just need to be able to:
#include <jsapi.h>
And perform all the necessary C++-to-JS (and vice-versa) operations.
I do not think I need to download and build the entire FireFox browser to do this (I maybe wrong?).
UPDATE - This answer is wrong. sparse checkout actually downloads all the history. One would have to use the
narrowhgext, which isn't supported on the hg.mozilla.org repo.the following answer is wrong.
You could use mercurial sparse checkout to just get the js/src folder. (but with all the history of the js/src folder it will still likely be quite big) This will just the history for js/src folder.
you need a version of mercurial which is newer then 3 years old (4.3 or newer)