vm: use v8::DeserializeInternalFieldsCallback explicitly
To avoid ambiguity in the signature. PR-URL: https://github.com/nodejs/node/pull/50984 Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
This commit is contained in:
parent
4b76ccea95
commit
429ec83e1b
@ -208,21 +208,24 @@ MaybeLocal<Context> ContextifyContext::CreateV8Context(
|
|||||||
|
|
||||||
Local<Context> ctx;
|
Local<Context> ctx;
|
||||||
if (snapshot_data == nullptr) {
|
if (snapshot_data == nullptr) {
|
||||||
ctx = Context::New(isolate,
|
ctx = Context::New(
|
||||||
nullptr, // extensions
|
isolate,
|
||||||
object_template,
|
nullptr, // extensions
|
||||||
{}, // global object
|
object_template,
|
||||||
{}, // deserialization callback
|
{}, // global object
|
||||||
queue);
|
v8::DeserializeInternalFieldsCallback(), // deserialization callback
|
||||||
|
queue);
|
||||||
if (ctx.IsEmpty() || InitializeBaseContextForSnapshot(ctx).IsNothing()) {
|
if (ctx.IsEmpty() || InitializeBaseContextForSnapshot(ctx).IsNothing()) {
|
||||||
return MaybeLocal<Context>();
|
return MaybeLocal<Context>();
|
||||||
}
|
}
|
||||||
} else if (!Context::FromSnapshot(isolate,
|
} else if (!Context::FromSnapshot(
|
||||||
SnapshotData::kNodeVMContextIndex,
|
isolate,
|
||||||
{}, // deserialization callback
|
SnapshotData::kNodeVMContextIndex,
|
||||||
nullptr, // extensions
|
v8::DeserializeInternalFieldsCallback(), // deserialization
|
||||||
{}, // global object
|
// callback
|
||||||
queue)
|
nullptr, // extensions
|
||||||
|
{}, // global object
|
||||||
|
queue)
|
||||||
.ToLocal(&ctx)) {
|
.ToLocal(&ctx)) {
|
||||||
return MaybeLocal<Context>();
|
return MaybeLocal<Context>();
|
||||||
}
|
}
|
||||||
|
@ -686,8 +686,13 @@ TEST_F(EnvironmentTest, NestedMicrotaskQueue) {
|
|||||||
|
|
||||||
std::unique_ptr<v8::MicrotaskQueue> queue = v8::MicrotaskQueue::New(
|
std::unique_ptr<v8::MicrotaskQueue> queue = v8::MicrotaskQueue::New(
|
||||||
isolate_, v8::MicrotasksPolicy::kExplicit);
|
isolate_, v8::MicrotasksPolicy::kExplicit);
|
||||||
v8::Local<v8::Context> context = v8::Context::New(
|
v8::Local<v8::Context> context =
|
||||||
isolate_, nullptr, {}, {}, {}, queue.get());
|
v8::Context::New(isolate_,
|
||||||
|
nullptr,
|
||||||
|
{},
|
||||||
|
{},
|
||||||
|
v8::DeserializeInternalFieldsCallback(),
|
||||||
|
queue.get());
|
||||||
node::InitializeContext(context);
|
node::InitializeContext(context);
|
||||||
v8::Context::Scope context_scope(context);
|
v8::Context::Scope context_scope(context);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user