Skip to content

Treat any mix of element/prop access as declaration in JS #34649

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

Merged
merged 1 commit into from
Oct 22, 2019

Conversation

sandersn
Copy link
Member

Fixes #34642 but, notably, doesn't actually make the assignment into a working declaration. It just fixes the crash.

Fixes #34642 but, notably, doesn't actually make the assignment into a
working declaration. It just fixes the crash.
return isLiteralLikeElementAccess(node)
&& ((!excludeThisKeyword && node.expression.kind === SyntaxKind.ThisKeyword) ||
isEntityNameExpression(node.expression) ||
isBindableStaticAccessExpression(node.expression, /*excludeThisKeyword*/ true));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the fix is actually here: previously it called isBindableStaticElementAccessExpression, which meant that element accesses had to be trailing; they were not allowed to be interspersed.

@sandersn sandersn requested a review from andrewbranch October 22, 2019 18:03
@sandersn
Copy link
Member Author

@RyanCavanaugh this needs to be cherry-picked into release-3.7, right? I'm not sure what the RC release state is.

@sandersn sandersn merged commit 1cbbe28 into master Oct 22, 2019
@sandersn sandersn deleted the fix-element-access-decl-kind branch October 22, 2019 18:28
@sandersn
Copy link
Member Author

@typescript-bot cherry-pick this

@sandersn
Copy link
Member Author

@typescript-bot cherry-pick this to release-3.7

And next time reply with syntax help

@typescript-bot
Copy link
Collaborator

Hey @sandersn, I've opened #34657 for you.

typescript-bot pushed a commit to typescript-bot/TypeScript that referenced this pull request Oct 22, 2019
Component commits:
b674481 Treat any mix of element/prop access as declaration in JS
Fixes microsoft#34642 but, notably, doesn't actually make the assignment into a
working declaration. It just fixes the crash.
sandersn added a commit that referenced this pull request Oct 22, 2019
Component commits:
b674481 Treat any mix of element/prop access as declaration in JS
Fixes #34642 but, notably, doesn't actually make the assignment into a
working declaration. It just fixes the crash.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TS3.7 regression: crash checking JS assigning properties in array literal
3 participants