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 ba71fe8

Browse filesBrowse files
apapirovskiMylesBorins
authored andcommitted
timers: check can_call_into_js in Immediates
Prevent an infinite loop if it's not possible to call into JS. PR-URL: #21057 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
1 parent 1e607d0 commit ba71fe8
Copy full SHA for ba71fe8

File tree

Expand file treeCollapse file tree

1 file changed

+4
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-1
lines changed
Open diff view settings
Collapse file

‎src/env.cc‎

Copy file name to clipboardExpand all lines: src/env.cc
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,14 +457,17 @@ void Environment::CheckImmediate(uv_check_t* handle) {
457457

458458
env->RunAndClearNativeImmediates();
459459

460+
if (!env->can_call_into_js())
461+
return;
462+
460463
do {
461464
MakeCallback(env->isolate(),
462465
env->process_object(),
463466
env->immediate_callback_function(),
464467
0,
465468
nullptr,
466469
{0, 0}).ToLocalChecked();
467-
} while (env->immediate_info()->has_outstanding());
470+
} while (env->immediate_info()->has_outstanding() && env->can_call_into_js());
468471

469472
if (env->immediate_info()->ref_count() == 0)
470473
env->ToggleImmediateRef(false);

0 commit comments

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