mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 08:11:30 -06:00
Use getInternalName not getLocalName (#20168)
This commit is contained in:
parent
16a882eb8b
commit
b2f2610b85
@ -859,7 +859,7 @@ namespace ts {
|
||||
statements.push(
|
||||
setTextRange(
|
||||
createStatement(
|
||||
createExtendsHelper(context, getLocalName(node))
|
||||
createExtendsHelper(context, getInternalName(node))
|
||||
),
|
||||
/*location*/ extendsClauseElement
|
||||
)
|
||||
|
||||
38
tests/baselines/reference/classExtensionNameOutput.js
Normal file
38
tests/baselines/reference/classExtensionNameOutput.js
Normal file
@ -0,0 +1,38 @@
|
||||
//// [classExtensionNameOutput.ts]
|
||||
class A {}
|
||||
if (true) {
|
||||
class B extends A {}
|
||||
|
||||
const foo = function () {
|
||||
new B();
|
||||
}
|
||||
}
|
||||
|
||||
//// [classExtensionNameOutput.js]
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
||||
return function (d, b) {
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
var A = /** @class */ (function () {
|
||||
function A() {
|
||||
}
|
||||
return A;
|
||||
}());
|
||||
if (true) {
|
||||
var B_1 = /** @class */ (function (_super) {
|
||||
__extends(B, _super);
|
||||
function B() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
return B;
|
||||
}(A));
|
||||
var foo = function () {
|
||||
new B_1();
|
||||
};
|
||||
}
|
||||
16
tests/baselines/reference/classExtensionNameOutput.symbols
Normal file
16
tests/baselines/reference/classExtensionNameOutput.symbols
Normal file
@ -0,0 +1,16 @@
|
||||
=== tests/cases/compiler/classExtensionNameOutput.ts ===
|
||||
class A {}
|
||||
>A : Symbol(A, Decl(classExtensionNameOutput.ts, 0, 0))
|
||||
|
||||
if (true) {
|
||||
class B extends A {}
|
||||
>B : Symbol(B, Decl(classExtensionNameOutput.ts, 1, 11))
|
||||
>A : Symbol(A, Decl(classExtensionNameOutput.ts, 0, 0))
|
||||
|
||||
const foo = function () {
|
||||
>foo : Symbol(foo, Decl(classExtensionNameOutput.ts, 4, 7))
|
||||
|
||||
new B();
|
||||
>B : Symbol(B, Decl(classExtensionNameOutput.ts, 1, 11))
|
||||
}
|
||||
}
|
||||
20
tests/baselines/reference/classExtensionNameOutput.types
Normal file
20
tests/baselines/reference/classExtensionNameOutput.types
Normal file
@ -0,0 +1,20 @@
|
||||
=== tests/cases/compiler/classExtensionNameOutput.ts ===
|
||||
class A {}
|
||||
>A : A
|
||||
|
||||
if (true) {
|
||||
>true : true
|
||||
|
||||
class B extends A {}
|
||||
>B : B
|
||||
>A : A
|
||||
|
||||
const foo = function () {
|
||||
>foo : () => void
|
||||
>function () { new B(); } : () => void
|
||||
|
||||
new B();
|
||||
>new B() : B
|
||||
>B : typeof B
|
||||
}
|
||||
}
|
||||
8
tests/cases/compiler/classExtensionNameOutput.ts
Normal file
8
tests/cases/compiler/classExtensionNameOutput.ts
Normal file
@ -0,0 +1,8 @@
|
||||
class A {}
|
||||
if (true) {
|
||||
class B extends A {}
|
||||
|
||||
const foo = function () {
|
||||
new B();
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user