Repository navigation
fix(regenerator): dispatch pending jump after finally to outer finally blocks - #18557
Merged
nicolo-ribaudo merged 2 commits intoNov 10, 2026
Merged
nicolo-ribaudo merged 2 commits into
nicolo-ribaudo merged 2 commits into
Conversation
Collaborator
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/63103 |
|
commit: |
JLHwung
approved these changes
Nov 9, 2026
JLHwung
left a comment
Contributor
There was a problem hiding this comment.
Could you add a new test case? (Both input and exec), for example,
try {
while (true) {
try {
try {
break;
} finally {
log("a");
}
} finally {
log("b");
}
}
log("afterLoop");
yield 1;
} finally {
log("outer");
}this PR should already pass this case. However, such case will ensure that any future change will not run the outer finally too early.
| @@ -0,0 +1,37 @@ | |||
| const breakEvents = []; | |||
Contributor
There was a problem hiding this comment.
Please add an input.js derived from the exec.js test, you can remove the assertions so we are sure the output is not changed, only the helper codes are updated.
Contributor
Author
JLHwung
approved these changes
Nov 10, 2026
Collaborator
|
Backported to 7.x in #18569. |
JLHwung
pushed a commit
to JLHwung/babel
that referenced
this pull request
Nov 10, 2026
…y blocks (babel#18557) * fix(regenerator): dispatch pending jump after finally to outer finally blocks * test(regenerator): add input/output snapshot and outer finally test case
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When an inner
finallyblock finished a pendingJump(breakorcontinue),invokeassignedctx.n = argdirectly without dispatching the jump throughContext_dispatchExceptionOrFinishOrAbrupt, which skipped outer enclosingfinallyblocks.