-
Notifications
You must be signed in to change notification settings - Fork 12.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove members that are invalid computed properties. (#58646)
- Loading branch information
1 parent
87918f5
commit 6856735
Showing
8 changed files
with
102 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
tests/baselines/reference/declarationEmitAnyComputedPropertyInClass.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
//// [tests/cases/compiler/declarationEmitAnyComputedPropertyInClass.ts] //// | ||
|
||
//// [ambient.d.ts] | ||
declare module "abcdefgh"; | ||
|
||
//// [main.ts] | ||
import Test from "abcdefgh"; | ||
|
||
export class C { | ||
[Test.someKey]() {}; | ||
} | ||
|
||
|
||
//// [main.js] | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.C = void 0; | ||
var abcdefgh_1 = require("abcdefgh"); | ||
var C = /** @class */ (function () { | ||
function C() { | ||
} | ||
C.prototype[abcdefgh_1.default.someKey] = function () { }; | ||
; | ||
return C; | ||
}()); | ||
exports.C = C; | ||
|
||
|
||
//// [main.d.ts] | ||
export declare class C { | ||
} |
18 changes: 18 additions & 0 deletions
18
tests/baselines/reference/declarationEmitAnyComputedPropertyInClass.symbols
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//// [tests/cases/compiler/declarationEmitAnyComputedPropertyInClass.ts] //// | ||
|
||
=== ambient.d.ts === | ||
declare module "abcdefgh"; | ||
>"abcdefgh" : Symbol("abcdefgh", Decl(ambient.d.ts, 0, 0)) | ||
|
||
=== main.ts === | ||
import Test from "abcdefgh"; | ||
>Test : Symbol(Test, Decl(main.ts, 0, 6)) | ||
|
||
export class C { | ||
>C : Symbol(C, Decl(main.ts, 0, 28)) | ||
|
||
[Test.someKey]() {}; | ||
>[Test.someKey] : Symbol(C[Test.someKey], Decl(main.ts, 2, 16)) | ||
>Test : Symbol(Test, Decl(main.ts, 0, 6)) | ||
} | ||
|
25 changes: 25 additions & 0 deletions
25
tests/baselines/reference/declarationEmitAnyComputedPropertyInClass.types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
//// [tests/cases/compiler/declarationEmitAnyComputedPropertyInClass.ts] //// | ||
|
||
=== ambient.d.ts === | ||
declare module "abcdefgh"; | ||
>"abcdefgh" : any | ||
|
||
=== main.ts === | ||
import Test from "abcdefgh"; | ||
>Test : any | ||
> : ^^^ | ||
|
||
export class C { | ||
>C : C | ||
> : ^ | ||
|
||
[Test.someKey]() {}; | ||
>[Test.someKey] : () => void | ||
> : ^^^^^^^^^^ | ||
>Test.someKey : any | ||
>Test : any | ||
> : ^^^ | ||
>someKey : any | ||
> : ^^^ | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
tests/cases/compiler/declarationEmitAnyComputedPropertyInClass.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// @declaration: true | ||
// @declaration | ||
|
||
// @filename: ambient.d.ts | ||
declare module "abcdefgh"; | ||
|
||
// @filename: main.ts | ||
import Test from "abcdefgh"; | ||
|
||
export class C { | ||
[Test.someKey]() {}; | ||
} |