-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(es/codegen): Emit computed getter and setter signatures (#8656)
**Description:** Emits computed getter/setter signatures.
- Loading branch information
Showing
3 changed files
with
41 additions
and
2 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
14 changes: 14 additions & 0 deletions
14
crates/swc_ecma_codegen/tests/fixture/typescript/interface/input.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,14 @@ | ||
const symbol1 = Symbol(); | ||
const symbol2 = Symbol(); | ||
const symbol3 = Symbol(); | ||
|
||
export interface Test { | ||
[symbol1]: string; | ||
[symbol2](): string; | ||
get [symbol3](): string; | ||
set [symbol3](value: string); | ||
prop1: string; | ||
method1(value: string, param2: number): string; | ||
get method2(): string; | ||
set method2(value: string); | ||
} |
13 changes: 13 additions & 0 deletions
13
crates/swc_ecma_codegen/tests/fixture/typescript/interface/output.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,13 @@ | ||
const symbol1 = Symbol(); | ||
const symbol2 = Symbol(); | ||
const symbol3 = Symbol(); | ||
export interface Test { | ||
[symbol1]: string; | ||
[symbol2](): string; | ||
get [symbol3](): string; | ||
set [symbol3](value: string); | ||
prop1: string; | ||
method1(value: string, param2: number): string; | ||
get method2(): string; | ||
set method2(value: string); | ||
} |