JavaScript bytecode compiler?

穿精又带淫゛_ 提交于 2019-12-01 05:32:41

问题


For a project I'm tangentially working on, I need a way to compile JavaScript into some intermediate language or bytecode so that I can single-step through it. I know that many of the JavaScript engines in modern browsers do something like this, but they don't make the resulting bytecode accessible. Is there a good off-the-shelf tool for this sort of JavaScript compilation?


回答1:


Not exactly sure of your needs, however maybe Rhino could work for you.

The JavaScript compiler translates JavaScript source into Java class files. The resulting Java class files can then be loaded and executed at another time, providing a convenient method for transfering JavaScript, and for avoiding translation cost.

More about the compile function is located here.



来源:https://stackoverflow.com/questions/5356786/javascript-bytecode-compiler

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!