jquery / esprima

ECMAScript parsing infrastructure for multipurpose analysis
http://esprima.org
BSD 2-Clause "Simplified" License
7.04k stars 786 forks source link

Is there API for mutating AST nodes? #2072

Closed naivefun closed 3 years ago

naivefun commented 3 years ago

Let's say I need detect some dangerous js api call, when I found it in the AST I'd like to remove the node, and re-generate the updated code from mutated AST nodes. How can I do that?

Meir017 commented 3 years ago

see https://github.com/estools/escodegen