mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-19 01:33:15 -05:00
Address PR comments
1. Test name.originalKeywordKind: SyntaxKind instead of name.text: string. 2. Revert regression in comment placement when emitting methods as function properties.
This commit is contained in:
@@ -2267,8 +2267,8 @@ namespace ts {
|
||||
transformFlags |= TransformFlags.AssertTypeScript;
|
||||
}
|
||||
|
||||
// If the parameter's name is 'this, then it is TypeScript syntax.
|
||||
if ((node.name as Identifier).text === "this") {
|
||||
// If the parameter's name is 'this', then it is TypeScript syntax.
|
||||
if (node.name && (node.name as Identifier).originalKeywordKind === SyntaxKind.ThisKeyword) {
|
||||
transformFlags |= TransformFlags.AssertTypeScript;
|
||||
}
|
||||
|
||||
|
||||
@@ -2115,12 +2115,12 @@ namespace ts {
|
||||
* This function will be called when one of the following conditions are met:
|
||||
* - The node has an accessibility modifier.
|
||||
* - The node has a questionToken.
|
||||
* - The node's text is "this".
|
||||
* - The node's kind is ThisKeyword.
|
||||
*
|
||||
* @param node The parameter declaration node.
|
||||
*/
|
||||
function visitParameter(node: ParameterDeclaration) {
|
||||
if ((node.name as Identifier).text === "this") {
|
||||
if (node.name && (node.name as Identifier).originalKeywordKind === SyntaxKind.ThisKeyword) {
|
||||
return undefined;
|
||||
}
|
||||
const clone = getMutableClone(node);
|
||||
|
||||
@@ -243,8 +243,7 @@ function implicitThis(n) {
|
||||
var impl = {
|
||||
a: 12,
|
||||
explicitVoid2: function () { return _this.a; },
|
||||
explicitVoid1: // ok, this: any because it refers to some outer object (window?)
|
||||
function () { return 12; },
|
||||
explicitVoid1: function () { return 12; },
|
||||
explicitStructural: function () {
|
||||
return this.a;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user