Closed ptomato closed 6 years ago
This is a minimal example, illustrating how to execute some JavaScript code in a string which just prints 'hello world' and the current date. It's basically copied from the existing example on MDN: https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/How_to_embed_the_JavaScript_engine
I've split it up into functions, made a few more modernizations, and turned off clang-format for the classops struct.
This is a minimal example, illustrating how to execute some JavaScript code in a string which just prints 'hello world' and the current date. It's basically copied from the existing example on MDN: https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/How_to_embed_the_JavaScript_engine