简体   繁体   English

JavaScript字节码编译器?

[英]JavaScript bytecode compiler?

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. 对于我正在进行的项目,我需要一种方法将JavaScript编译成一些中间语言或字节码,以便我可以单步执行它。 I know that many of the JavaScript engines in modern browsers do something like this, but they don't make the resulting bytecode accessible. 我知道现代浏览器中的许多JavaScript引擎都是这样做的,但它们并不能使得生成的字节码可访问。 Is there a good off-the-shelf tool for this sort of JavaScript compilation? 这种JavaScript编译有一个很好的现成工具吗?

Not exactly sure of your needs, however maybe Rhino could work for you. 不完全确定您的需求,但Rhino可能适合您。

The JavaScript compiler translates JavaScript source into Java class files. JavaScript编译器将JavaScript源转换为Java类文件。 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. 然后可以在另一个时间加载和执行生成的Java类文件,从而提供一种传输JavaScript的便捷方法,并避免转换成本。

More about the compile function is located here . 有关编译功能的更多信息,请点击此处

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM