Use InternalCallbackScope for ticking event loop

This commit is contained in:
Cheng Zhao 2018-03-09 14:54:25 +09:00
parent 50a5a69c46
commit 5d2452608d
3 changed files with 8 additions and 11 deletions

View file

@ -97,16 +97,11 @@ void AtomBindings::OnCallNextTick(uv_async_t* handle) {
for (std::list<node::Environment*>::const_iterator it = for (std::list<node::Environment*>::const_iterator it =
self->pending_next_ticks_.begin(); self->pending_next_ticks_.begin();
it != self->pending_next_ticks_.end(); ++it) { it != self->pending_next_ticks_.end(); ++it) {
node::Environment* env = *it; node::InternalCallbackScope scope(
// KickNextTick, copied from node.cc: *it,
node::Environment::AsyncCallbackScope callback_scope(env); v8::Local<v8::Object>(),
if (callback_scope.in_makecallback()) {0, 0},
continue; node::InternalCallbackScope::kAllowEmptyResource);
node::Environment::TickInfo* tick_info = env->tick_info();
if (!tick_info->has_scheduled())
env->isolate()->RunMicrotasks();
v8::Local<v8::Object> process = env->process_object();
env->tick_callback_function()->Call(process, 0, nullptr).IsEmpty();
} }
self->pending_next_ticks_.clear(); self->pending_next_ticks_.clear();

View file

@ -61,6 +61,7 @@
4055, # 'type cast' : from data pointer 'void *' to function pointer 4055, # 'type cast' : from data pointer 'void *' to function pointer
4057, # 'function' : 'volatile LONG *' differs in indirection to slightly different base types from 'unsigned long *' 4057, # 'function' : 'volatile LONG *' differs in indirection to slightly different base types from 'unsigned long *'
4065, # switch statement contains 'default' but no 'case' labels 4065, # switch statement contains 'default' but no 'case' labels
4129, # unrecognized character escape sequence
4189, # 4189, #
4131, # uses old-style declarator 4131, # uses old-style declarator
4133, # incompatible types 4133, # incompatible types
@ -74,6 +75,7 @@
4232, # address of dllimport 'free' is not static, identity not guaranteed 4232, # address of dllimport 'free' is not static, identity not guaranteed
4291, # no matching operator delete found 4291, # no matching operator delete found
4295, # array is too small to include a terminating null character 4295, # array is too small to include a terminating null character
4309, # 'static_cast': truncation of constant value
4311, # 'type cast': pointer truncation from 'void *const ' to 'unsigned long' 4311, # 'type cast': pointer truncation from 'void *const ' to 'unsigned long'
4389, # '==' : signed/unsigned mismatch 4389, # '==' : signed/unsigned mismatch
4456, # declaration of 'm' hides previous local declaration 4456, # declaration of 'm' hides previous local declaration

2
vendor/node vendored

@ -1 +1 @@
Subproject commit ac00467c8b6954cbb6b9b64c4643af522a1c207e Subproject commit 668f3cd06e0b9c24a1aa2d913f22626fff7decd2