js.jsJavaScript 解释器
js.js 是一个用 JavaScript 编写的 JavaScript 解释器
Instead of trying to create an interpreter from scratch, SpiderMonkey is compiled into LLVM and then emscripten translates the output into JavaScript.
示例代码:
var jsObjs = JSJS.Init(); var rval = JSJS.EvaluateScript(jsObjs.cx, jsObjs.glob, "1 + 1"); var d = JSJS.ValueToNumber(jsObjs.cx, rval); window.alert(d); //2 JSJS.End(jsObjs);
评论