File tree 3 files changed +5
-6
lines changed
tests/baselines/reference
3 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -2267,8 +2267,8 @@ namespace ts {
2267
2267
transformFlags |= TransformFlags . AssertTypeScript ;
2268
2268
}
2269
2269
2270
- // If the parameter's name is 'this, then it is TypeScript syntax.
2271
- if ( ( node . name as Identifier ) . text === "this" ) {
2270
+ // If the parameter's name is 'this' , then it is TypeScript syntax.
2271
+ if ( node . name && ( node . name as Identifier ) . originalKeywordKind === SyntaxKind . ThisKeyword ) {
2272
2272
transformFlags |= TransformFlags . AssertTypeScript ;
2273
2273
}
2274
2274
Original file line number Diff line number Diff line change @@ -2115,12 +2115,12 @@ namespace ts {
2115
2115
* This function will be called when one of the following conditions are met:
2116
2116
* - The node has an accessibility modifier.
2117
2117
* - The node has a questionToken.
2118
- * - The node's text is "this" .
2118
+ * - The node's kind is ThisKeyword .
2119
2119
*
2120
2120
* @param node The parameter declaration node.
2121
2121
*/
2122
2122
function visitParameter ( node : ParameterDeclaration ) {
2123
- if ( ( node . name as Identifier ) . text === "this" ) {
2123
+ if ( node . name && ( node . name as Identifier ) . originalKeywordKind === SyntaxKind . ThisKeyword ) {
2124
2124
return undefined ;
2125
2125
}
2126
2126
const clone = getMutableClone ( node ) ;
Original file line number Diff line number Diff line change @@ -243,8 +243,7 @@ function implicitThis(n) {
243
243
var impl = {
244
244
a : 12 ,
245
245
explicitVoid2 : function ( ) { return _this . a ; } ,
246
- explicitVoid1 : // ok, this: any because it refers to some outer object (window?)
247
- function ( ) { return 12 ; } ,
246
+ explicitVoid1 : function ( ) { return 12 ; } ,
248
247
explicitStructural : function ( ) {
249
248
return this . a ;
250
249
} ,
You can’t perform that action at this time.
0 commit comments