Skip to content

Commit e178a43

Browse files
joyeecheungRafaelGSS
authored andcommitted
vm: use v8::DeserializeInternalFieldsCallback explicitly
To avoid ambiguity in the signature. PR-URL: #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>
1 parent cc94986 commit e178a43

File tree

2 files changed

+22
-14
lines changed

2 files changed

+22
-14
lines changed

src/node_contextify.cc

+15-12
Original file line numberDiff line numberDiff line change
@@ -208,21 +208,24 @@ MaybeLocal<Context> ContextifyContext::CreateV8Context(
208208

209209
Local<Context> ctx;
210210
if (snapshot_data == nullptr) {
211-
ctx = Context::New(isolate,
212-
nullptr, // extensions
213-
object_template,
214-
{}, // global object
215-
{}, // deserialization callback
216-
queue);
211+
ctx = Context::New(
212+
isolate,
213+
nullptr, // extensions
214+
object_template,
215+
{}, // global object
216+
v8::DeserializeInternalFieldsCallback(), // deserialization callback
217+
queue);
217218
if (ctx.IsEmpty() || InitializeBaseContextForSnapshot(ctx).IsNothing()) {
218219
return MaybeLocal<Context>();
219220
}
220-
} else if (!Context::FromSnapshot(isolate,
221-
SnapshotData::kNodeVMContextIndex,
222-
{}, // deserialization callback
223-
nullptr, // extensions
224-
{}, // global object
225-
queue)
221+
} else if (!Context::FromSnapshot(
222+
isolate,
223+
SnapshotData::kNodeVMContextIndex,
224+
v8::DeserializeInternalFieldsCallback(), // deserialization
225+
// callback
226+
nullptr, // extensions
227+
{}, // global object
228+
queue)
226229
.ToLocal(&ctx)) {
227230
return MaybeLocal<Context>();
228231
}

test/cctest/test_environment.cc

+7-2
Original file line numberDiff line numberDiff line change
@@ -686,8 +686,13 @@ TEST_F(EnvironmentTest, NestedMicrotaskQueue) {
686686

687687
std::unique_ptr<v8::MicrotaskQueue> queue = v8::MicrotaskQueue::New(
688688
isolate_, v8::MicrotasksPolicy::kExplicit);
689-
v8::Local<v8::Context> context = v8::Context::New(
690-
isolate_, nullptr, {}, {}, {}, queue.get());
689+
v8::Local<v8::Context> context =
690+
v8::Context::New(isolate_,
691+
nullptr,
692+
{},
693+
{},
694+
v8::DeserializeInternalFieldsCallback(),
695+
queue.get());
691696
node::InitializeContext(context);
692697
v8::Context::Scope context_scope(context);
693698

0 commit comments

Comments
 (0)