当前位置: 软件>JavaScript软件
JavaScript 解释器 js.js
本文导语: 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, js...
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);