-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Filter #private static members from js declaration emit
- Loading branch information
Showing
5 changed files
with
87 additions
and
1 deletion.
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
20 changes: 20 additions & 0 deletions
20
tests/baselines/reference/declarationEmitJsPrivateClassStatics.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,20 @@ | ||
//// [tests/cases/compiler/declarationEmitJsPrivateClassStatics.ts] //// | ||
|
||
//// [input.js] | ||
class Test { | ||
static #privateStaticProp = 'Not removed for JS declaration generation; is removed for TS.'; | ||
|
||
static #privateStaticFn() { return 'Not removed for JS declaration generation; is removed for TS.'; } | ||
|
||
#privateProp = 'This is removed in JS / TS declaration generation.'; | ||
|
||
#privateFn() { return 'This is removed in JS / TS declaration generation.'; } | ||
} | ||
|
||
|
||
|
||
|
||
//// [input.d.ts] | ||
declare class Test { | ||
#private; | ||
} |
19 changes: 19 additions & 0 deletions
19
tests/baselines/reference/declarationEmitJsPrivateClassStatics.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,19 @@ | ||
//// [tests/cases/compiler/declarationEmitJsPrivateClassStatics.ts] //// | ||
|
||
=== input.js === | ||
class Test { | ||
>Test : Symbol(Test, Decl(input.js, 0, 0)) | ||
|
||
static #privateStaticProp = 'Not removed for JS declaration generation; is removed for TS.'; | ||
>#privateStaticProp : Symbol(Test.#privateStaticProp, Decl(input.js, 0, 12)) | ||
|
||
static #privateStaticFn() { return 'Not removed for JS declaration generation; is removed for TS.'; } | ||
>#privateStaticFn : Symbol(Test.#privateStaticFn, Decl(input.js, 1, 96)) | ||
|
||
#privateProp = 'This is removed in JS / TS declaration generation.'; | ||
>#privateProp : Symbol(Test.#privateProp, Decl(input.js, 3, 105)) | ||
|
||
#privateFn() { return 'This is removed in JS / TS declaration generation.'; } | ||
>#privateFn : Symbol(Test.#privateFn, Decl(input.js, 5, 72)) | ||
} | ||
|
32 changes: 32 additions & 0 deletions
32
tests/baselines/reference/declarationEmitJsPrivateClassStatics.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,32 @@ | ||
//// [tests/cases/compiler/declarationEmitJsPrivateClassStatics.ts] //// | ||
|
||
=== input.js === | ||
class Test { | ||
>Test : Test | ||
> : ^^^^ | ||
|
||
static #privateStaticProp = 'Not removed for JS declaration generation; is removed for TS.'; | ||
>#privateStaticProp : string | ||
> : ^^^^^^ | ||
>'Not removed for JS declaration generation; is removed for TS.' : "Not removed for JS declaration generation; is removed for TS." | ||
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
static #privateStaticFn() { return 'Not removed for JS declaration generation; is removed for TS.'; } | ||
>#privateStaticFn : () => string | ||
> : ^^^^^^^^^^^^ | ||
>'Not removed for JS declaration generation; is removed for TS.' : "Not removed for JS declaration generation; is removed for TS." | ||
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
#privateProp = 'This is removed in JS / TS declaration generation.'; | ||
>#privateProp : string | ||
> : ^^^^^^ | ||
>'This is removed in JS / TS declaration generation.' : "This is removed in JS / TS declaration generation." | ||
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
#privateFn() { return 'This is removed in JS / TS declaration generation.'; } | ||
>#privateFn : () => string | ||
> : ^^^^^^^^^^^^ | ||
>'This is removed in JS / TS declaration generation.' : "This is removed in JS / TS declaration generation." | ||
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
} | ||
|
14 changes: 14 additions & 0 deletions
14
tests/cases/compiler/declarationEmitJsPrivateClassStatics.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 @@ | ||
// @allowJs: true | ||
// @emitDeclarationOnly: true | ||
// @declaration: true | ||
// @target: es2015 | ||
// @filename: input.js | ||
class Test { | ||
static #privateStaticProp = 'Not removed for JS declaration generation; is removed for TS.'; | ||
|
||
static #privateStaticFn() { return 'Not removed for JS declaration generation; is removed for TS.'; } | ||
|
||
#privateProp = 'This is removed in JS / TS declaration generation.'; | ||
|
||
#privateFn() { return 'This is removed in JS / TS declaration generation.'; } | ||
} |