Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b9d21e5

Browse filesBrowse files
addaleaxBridgeAR
authored andcommitted
src: fix off-by-one error in native SetImmediate
Previously, the throwing callback would have been re-executed in case of an exception. This patch corrects the calculation to exclude the callback. PR-URL: #28082 Fixes: #26754 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 07ab591 commit b9d21e5
Copy full SHA for b9d21e5

File tree

Expand file treeCollapse file tree

1 file changed

+5
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-0
lines changed
Open diff view settings
Collapse file

‎src/env.cc‎

Copy file name to clipboardExpand all lines: src/env.cc
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,11 @@ void Environment::RunAndClearNativeImmediates() {
641641
if (!try_catch.HasTerminated())
642642
FatalException(isolate(), try_catch);
643643

644+
// We are done with the current callback. Increase the counter so that
645+
// the steps below make everything *after* the current item part of
646+
// the new list.
647+
it++;
648+
644649
// Bail out, remove the already executed callbacks from list
645650
// and set up a new TryCatch for the other pending callbacks.
646651
std::move_backward(it, list.end(), list.begin() + (list.end() - it));

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.