diff options
author | Anna Henningsen <anna@addaleax.net> | 2020-07-14 20:06:37 +0300 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2020-07-20 21:37:08 +0300 |
commit | 00823f29677c2fc6d2c543970cf18769d09b6a31 (patch) | |
tree | ad98452e9baa9cc21847cabf9aef5293f9431ad4 /src/env.cc | |
parent | 01bd8102ef4c66fbdb7e01ed17e976a46bfcf5d9 (diff) |
src: add callback scope for native immediates
This ensures that microtasks scheduled by native immediates are run
after the tasks are done. In particular, this affects the inspector
integration since 6f9f546406820dc.
Fixes: https://github.com/nodejs/node/issues/33002
Refs: https://github.com/nodejs/node/pull/32523
PR-URL: https://github.com/nodejs/node/pull/34366
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/env.cc')
-rw-r--r-- | src/env.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/env.cc b/src/env.cc index 1cf37d4fa91..62012262aa0 100644 --- a/src/env.cc +++ b/src/env.cc @@ -698,6 +698,9 @@ void Environment::RunAndClearInterrupts() { void Environment::RunAndClearNativeImmediates(bool only_refed) { TraceEventScope trace_scope(TRACING_CATEGORY_NODE1(environment), "RunAndClearNativeImmediates", this); + HandleScope handle_scope(isolate_); + InternalCallbackScope cb_scope(this, Object::New(isolate_), { 0, 0 }); + size_t ref_count = 0; // Handle interrupts first. These functions are not allowed to throw |