-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Ignored catch parameter #17517
Merged
Merged
Ignored catch parameter #17517
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
b17bd97
Clean up
tinganho 99c662b
Add diagnostics
tinganho b917eb0
Adds optional catch parameter into the compiler
tinganho 148a494
Adds transformers for ignored catch parameter
tinganho e349943
Add tests
tinganho 90ea10e
Accept baselines
tinganho c65e5a1
Removes valid test cases from invalid test case file
tinganho de38ef7
remove debugger
tinganho 58c8a2c
adds test for try-catch-finally
tinganho 81fb3f7
Addresses CR feedback
tinganho dbdbb05
Accept baselines
tinganho 1926285
Fixes CR comments
tinganho 053b708
Accept baseline
tinganho d5c24f3
Addresses CR comment
tinganho f9e85ec
Adds missing test cases
tinganho 4f3e13a
Typo
tinganho 3da1a53
Amend comment about explicitly setting catch clause variables to 'und…
DanielRosenwasser 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 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
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
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
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
22 changes: 22 additions & 0 deletions
22
tests/baselines/reference/emitter.noCatchBinding.esnext.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,22 @@ | ||
//// [emitter.noCatchBinding.esnext.ts] | ||
function f() { | ||
try { } catch { } | ||
try { } catch { | ||
try { } catch { } | ||
} | ||
try { } catch { } finally { } | ||
} | ||
|
||
//// [emitter.noCatchBinding.esnext.js] | ||
function f() { | ||
try { } | ||
catch { } | ||
try { } | ||
catch { | ||
try { } | ||
catch { } | ||
} | ||
try { } | ||
catch { } | ||
finally { } | ||
} |
10 changes: 10 additions & 0 deletions
10
tests/baselines/reference/emitter.noCatchBinding.esnext.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,10 @@ | ||
=== tests/cases/conformance/emitter/esnext/noCatchBinding/emitter.noCatchBinding.esnext.ts === | ||
function f() { | ||
>f : Symbol(f, Decl(emitter.noCatchBinding.esnext.ts, 0, 0)) | ||
|
||
try { } catch { } | ||
try { } catch { | ||
try { } catch { } | ||
} | ||
try { } catch { } finally { } | ||
} |
10 changes: 10 additions & 0 deletions
10
tests/baselines/reference/emitter.noCatchBinding.esnext.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,10 @@ | ||
=== tests/cases/conformance/emitter/esnext/noCatchBinding/emitter.noCatchBinding.esnext.ts === | ||
function f() { | ||
>f : () => void | ||
|
||
try { } catch { } | ||
try { } catch { | ||
try { } catch { } | ||
} | ||
try { } catch { } finally { } | ||
} |
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Conditionally setting
result.variableDeclaration
introduces polymorphism as we now have twoCatchClause
shapes, one with the property and one without. This can cause performance degradation in V8 (NodeJS). I would recommend you add anelse
clause that setsresult.variableDeclaration = undefined
to keep the shape ofCatchClause
the same regardless of which form the user writes.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✔️