Skip to content

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.

// 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

4 participants