-
Notifications
You must be signed in to change notification settings - Fork 12.9k
fix(47158): Removes comments when line variable declaration #47407
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 4 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
4432e96
fix emit when one line variable declaration removeComment false
islandryu d678447
Add internal to typeNode functions
islandryu 648354f
Update src/compiler/emitter.ts
islandryu 2b7da30
Update src/compiler/transformers/ts.ts
islandryu 37d6149
Update src/compiler/emitter.ts
islandryu 5f47501
Update src/compiler/transformers/ts.ts
islandryu 6dafbef
Update src/compiler/emitter.ts
islandryu 5b7c379
Update src/compiler/transformers/ts.ts
islandryu d922a44
baseline accept
islandryu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
tests/baselines/reference/emitOneLineVariableDeclarationRemoveCommentsFalse.js
This file contains hidden or 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 @@ | ||
//// [emitOneLineVariableDeclarationRemoveCommentsFalse.ts] | ||
let a = /*[[${something}]]*/ {}; | ||
let b: any = /*[[${something}]]*/ {}; | ||
let c: { hoge: boolean } = /*[[${something}]]*/ { hoge: true }; | ||
let d: any /*[[${something}]]*/ = {}; | ||
let e/*[[${something}]]*/: any = {}; | ||
|
||
|
||
//// [emitOneLineVariableDeclarationRemoveCommentsFalse.js] | ||
var a = /*[[${something}]]*/ {}; | ||
var b = /*[[${something}]]*/ {}; | ||
var c = /*[[${something}]]*/ { hoge: true }; | ||
var d /*[[${something}]]*/ = {}; | ||
var e /*[[${something}]]*/ = {}; |
18 changes: 18 additions & 0 deletions
18
tests/baselines/reference/emitOneLineVariableDeclarationRemoveCommentsFalse.symbols
This file contains hidden or 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/emitOneLineVariableDeclarationRemoveCommentsFalse.ts === | ||
let a = /*[[${something}]]*/ {}; | ||
>a : Symbol(a, Decl(emitOneLineVariableDeclarationRemoveCommentsFalse.ts, 0, 3)) | ||
|
||
let b: any = /*[[${something}]]*/ {}; | ||
>b : Symbol(b, Decl(emitOneLineVariableDeclarationRemoveCommentsFalse.ts, 1, 3)) | ||
|
||
let c: { hoge: boolean } = /*[[${something}]]*/ { hoge: true }; | ||
>c : Symbol(c, Decl(emitOneLineVariableDeclarationRemoveCommentsFalse.ts, 2, 3)) | ||
>hoge : Symbol(hoge, Decl(emitOneLineVariableDeclarationRemoveCommentsFalse.ts, 2, 8)) | ||
>hoge : Symbol(hoge, Decl(emitOneLineVariableDeclarationRemoveCommentsFalse.ts, 2, 49)) | ||
|
||
let d: any /*[[${something}]]*/ = {}; | ||
>d : Symbol(d, Decl(emitOneLineVariableDeclarationRemoveCommentsFalse.ts, 3, 3)) | ||
|
||
let e/*[[${something}]]*/: any = {}; | ||
>e : Symbol(e, Decl(emitOneLineVariableDeclarationRemoveCommentsFalse.ts, 4, 3)) | ||
|
24 changes: 24 additions & 0 deletions
24
tests/baselines/reference/emitOneLineVariableDeclarationRemoveCommentsFalse.types
This file contains hidden or 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,24 @@ | ||
=== tests/cases/compiler/emitOneLineVariableDeclarationRemoveCommentsFalse.ts === | ||
let a = /*[[${something}]]*/ {}; | ||
>a : {} | ||
>{} : {} | ||
|
||
let b: any = /*[[${something}]]*/ {}; | ||
>b : any | ||
>{} : {} | ||
|
||
let c: { hoge: boolean } = /*[[${something}]]*/ { hoge: true }; | ||
>c : { hoge: boolean; } | ||
>hoge : boolean | ||
>{ hoge: true } : { hoge: true; } | ||
>hoge : true | ||
>true : true | ||
|
||
let d: any /*[[${something}]]*/ = {}; | ||
>d : any | ||
>{} : {} | ||
|
||
let e/*[[${something}]]*/: any = {}; | ||
>e : any | ||
>{} : {} | ||
|
7 changes: 7 additions & 0 deletions
7
tests/cases/compiler/emitOneLineVariableDeclarationRemoveCommentsFalse.ts
This file contains hidden or 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,7 @@ | ||
// @removeComments: false | ||
|
||
let a = /*[[${something}]]*/ {}; | ||
let b: any = /*[[${something}]]*/ {}; | ||
let c: { hoge: boolean } = /*[[${something}]]*/ { hoge: true }; | ||
let d: any /*[[${something}]]*/ = {}; | ||
let e/*[[${something}]]*/: any = {}; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.