escodegen icon indicating copy to clipboard operation
escodegen copied to clipboard

ECMAScript code generator

Results 108 escodegen issues
Sort by recently updated
recently updated
newest added

Support this [Stage 4 proposal](https://github.com/tc39/proposal-optional-catch-binding) to allow omission of `catch` variable in cases where the error is unused: ```javascript try { // ... } catch { // ... } ```...

Acorn and Meriyah are generating trees that have .start and .end properties without wrapping .range array. I added support for parsing such trees + tests to check our range usage

I figured it out and the reasons: A. escodegen build depend on the 'cjsify' tool which is part of the commonjs-everywhere npm package. B. The npm installed version of escodegen...

Fix broken parens on return statements with leading comments

## Bug description raw code like: ```javascript export default { a() {} } ``` escodegen generates sourcemap now is: ```javascript { mappings: 'AAAA;AAAA;AAAA;AAAA', // other properties } ``` the correct...

There are some Chinese chars in my code , example : ``` var name = "大城小胖(fins)"; ``` I use `escodegen.generate` to re-generate my code , the string become : ```...

In escodegen.js, converting a null object into source code in AST will generate an error on toString(). This is because the original judgment considers that the null object node has...

The harmony branch of esprima supports ES6 template strings but when I pass it to escodegen I get: ``` Error: Unknown expression type: TemplateLiteral ```

Example source code ``` class Foo { constructor() { if (new.target === Foo) {} } } ``` AST: http://esprima.org/demo/parse.html?code=class%20Foo%20%7B%0A%20%20%20%20constructor()%20%7B%0A%20%20%20%20%20%20%20%20if%20(new.target%20%3D%3D%3D%20Foo)%20%7B%7D%0A%20%20%20%20%7D%0A%7D%0A Generated code from AST will be like: ``` class Foo {...