-
Notifications
You must be signed in to change notification settings - Fork 926
Remove expression
property from Function{Declaration,Expression}
#1361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
@@ -964,7 +964,6 @@ pp.parseFunctionBody = function(node, isArrowFunction, isMethod, forInit) { | |||
|
|||
if (isExpression) { | |||
node.body = this.parseMaybeAssign(forInit) | |||
node.expression = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vg
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AethrSX2
expression
property onFunctionDeclration
,FunctionExpression
, andis deprecated in ESTree https://github.com/estree/estree/blob/master/deprecated.md#functions long time agoArrowFunctionExpreesion