Skip to content

Prevent renaming this parameters #9171

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

Closed
wants to merge 1 commit into from

Conversation

sandersn
Copy link
Member

Fixes #9037

I'm going to look into making the parser allow a ThisKeyword as a ParameterDeclaration, but I think this will turn out to be the right fix.

@@ -7999,7 +7999,7 @@ namespace ts {

// Can only rename an identifier.
if (node) {
if (node.kind === SyntaxKind.Identifier ||
if ((node.kind === SyntaxKind.Identifier && (node as Identifier).originalKeywordKind !== SyntaxKind.ThisKeyword) ||
Copy link
Contributor

@mhegazy mhegazy Jun 15, 2016

Choose a reason for hiding this comment

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

wouldn't this block renaming this:

var x = {
    this: 0
};
x.this;

@sandersn
Copy link
Member Author

Closing in favour of #9270.

@sandersn sandersn closed this Jun 21, 2016
@mhegazy mhegazy deleted the prevent-renaming-this-parameter branch June 21, 2016 17:39
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

this-function parameter can be renamed
3 participants