JavaScript bytecode compiler?

2019-02-19 03:02发布

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条回答
欢心
2楼-- · 2019-02-19 03:32

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.

查看更多
登录 后发表回答