-
Notifications
You must be signed in to change notification settings - Fork 33
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
Function fixes #323
Function fixes #323
Conversation
Conflicts with postfix while/until notation
Wasn't working when semicolon was inserted between `then` and `else`. Improve AST so this is less brittle.
Invalid JS otherwise
@@ -78,6 +78,7 @@ uncacheable = new Set [ | |||
"NestedJSXChildExpression" | |||
"NestedObject" | |||
"NestedPropertyDefinitions" | |||
"NonSingleBracedBlock" | |||
"NonSuppressedTrailingMemberExpressions" | |||
"ObjectLiteral" | |||
"PopIndent" |
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.
We should probably also add PostfixedExpression
to no-cache rules since AssignmentExpression
and ExtendedExpression
are no-cache.
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.
Good point. I added PostfixedExpression
and PostfixedStatement
.
Nice! Great work cleaning up those edge cases, lots of great fixes here! |
The following changes are in separate commits for easier review:
try
expression which wants postfix to be outside, anddo
expression which needs to treatwhile
postfix as something completely different.while
/until
as beginning of implicit callsfor
while
/until
notationx while y;
got treated as a callx(while y {})
before=>
=> x; y
, matching existing behavior for->
else
clausethen
andelse
.-> if x then y else z
wasn't returningz
-> x while y;
was still returningfunction
expressions in parensSyntaxError: Function statements require a function name