mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Classify this in parameter position as a keyword
This commit is contained in:
@@ -7533,7 +7533,8 @@ namespace ts {
|
||||
return;
|
||||
case SyntaxKind.Parameter:
|
||||
if ((<ParameterDeclaration>token.parent).name === token) {
|
||||
return ClassificationType.parameterName;
|
||||
const isThis = token.kind === SyntaxKind.Identifier && (<Identifier>token).originalKeywordKind === SyntaxKind.ThisKeyword;
|
||||
return isThis ? ClassificationType.keyword : ClassificationType.parameterName;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
/// <reference path="fourslash.ts"/>
|
||||
|
||||
////function f(this){}
|
||||
|
||||
var c = classification;
|
||||
verify.syntacticClassificationsAre(
|
||||
c.keyword("function"),
|
||||
c.identifier("f"),
|
||||
c.punctuation("("),
|
||||
c.keyword("this"),
|
||||
c.punctuation(")"),
|
||||
c.punctuation("{"),
|
||||
c.punctuation("}"));
|
||||
Reference in New Issue
Block a user