Enter context scope before InternalCallbackScope

This commit is contained in:
Cheng Zhao 2018-03-09 16:14:24 +09:00
parent 83f01096c0
commit e79b18762e

View file

@ -8,6 +8,7 @@
#include <iostream> #include <iostream>
#include <string> #include <string>
#include "atom/common/api/locker.h"
#include "atom/common/atom_version.h" #include "atom/common/atom_version.h"
#include "atom/common/chrome_version.h" #include "atom/common/chrome_version.h"
#include "atom/common/native_mate_converters/string16_converter.h" #include "atom/common/native_mate_converters/string16_converter.h"
@ -97,8 +98,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;
mate::Locker locker(env->isolate());
v8::Context::Scope context_scope(env->context());
node::InternalCallbackScope scope( node::InternalCallbackScope scope(
*it, env,
v8::Local<v8::Object>(), v8::Local<v8::Object>(),
{0, 0}, {0, 0},
node::InternalCallbackScope::kAllowEmptyResource); node::InternalCallbackScope::kAllowEmptyResource);