JavaScript AST

Abstract Syntax Tree for JavaScript. Based on Mozilla Spidermonkey AST (Mozilla documentation). Changes from Mozilla are listed in the source. ECMAScript 5 syntax is supported, without Mozilla extensions.

The JavaScript parser is produced by PanPG and returns a parse tree. The code in js_ast.js walks the parse tree and generates an AST. It is currently slow because the parser is slow, see the PanPG roadmap for details.

Enter JavaScript below or try the examples.