Remove expression property from Function{Declaration,Expression}#1361
Remove expression property from Function{Declaration,Expression}#1361fisker wants to merge 2 commits intoacornjs:masterfrom
expression property from Function{Declaration,Expression}#1361Conversation
|
|
||
| if (isExpression) { | ||
| node.body = this.parseMaybeAssign(forInit) | ||
| node.expression = true |
There was a problem hiding this comment.
I'm sorry if I'm wrong, but I think the expression property is required for ArrowFunctionExpression.
https://github.com/estree/estree/blob/master/es2015.md#arrowfunctionexpression
There was a problem hiding this comment.
Thanks! Realized that after I open this, so I put this into draft. And opened an issue about it in ESTree estree/estree#323
There was a problem hiding this comment.
You are right ArrowFunctionExpression.expression is required.
14a6c9d to
95d92d2
Compare
expression property from Function{Declaration,Expression}
|
I feel it's likely that some users of the library are likely to be relying on this (either because their code is old, or because they found the property in the output and decided to use it). I know acorn-walk does, for one thing. As such, I do not think making this change in a non-major release would be a good idea. |
|
To clarify, And
Are you referring this line ? Line 266 in 82233bf It should still work the same as before. Anyway, I understand your concern, it's acceptable if you want to do this in a major release. |
expressionproperty onFunctionDeclration,FunctionExpression, andis deprecated in ESTree https://github.com/estree/estree/blob/master/deprecated.md#functions long time agoArrowFunctionExpreesion