Open t2ym opened 6 years ago
escodegen
cannot properly handle redundant parentheses including a newline just after the left parenthesis after return
statement
() => { return (
1); }
escodegen
-generated (automatic semicolon insertion by JavaScript parser)() => { return
1; }
espree
-generated ASTs retain redundant parentheses for escodegen
?escodegen
insert parentheses for return
statement argument if the return
token is followed by a newline?
[v8 engine] Arrow functions with newline after
return
statement returns undefinedRoot Cause
v8 has a bug that fails to parse newline after return in functionsSee the comment belowReproducible Code Examples
Side Effects in hooking
return
are hiding the issuereturn
are omitted in code generationundefined
Workaround
compact=true
option to eliminate extra whitespaces