Skip to content

Commit 8104d15

Browse files
joyeecheungnodejs-github-bot
authored andcommitted
src: migrate to SetEmbedderDataV3
Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com>
1 parent ec13ffb commit 8104d15

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

‎src/api/environment.cc‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -847,7 +847,7 @@ Maybe<void> InitializeContextRuntime(Local<Context> context) {
847847
bool is_code_generation_from_strings_allowed =
848848
context->IsCodeGenerationFromStringsAllowed();
849849
context->AllowCodeGenerationFromStrings(false);
850-
context->SetEmbedderData(
850+
context->SetEmbedderDataV3(
851851
ContextEmbedderIndex::kAllowCodeGenerationFromStrings,
852852
Boolean::New(isolate, is_code_generation_from_strings_allowed));
853853

@@ -943,9 +943,9 @@ Maybe<void> InitializeMainContextForSnapshot(Local<Context> context) {
943943
HandleScope handle_scope(isolate);
944944

945945
// Initialize the default values.
946-
context->SetEmbedderData(ContextEmbedderIndex::kAllowWasmCodeGeneration,
946+
context->SetEmbedderDataV3(ContextEmbedderIndex::kAllowWasmCodeGeneration,
947947
True(isolate));
948-
context->SetEmbedderData(
948+
context->SetEmbedderDataV3(
949949
ContextEmbedderIndex::kAllowCodeGenerationFromStrings, True(isolate));
950950

951951
if (InitializeBaseContextForSnapshot(context).IsNothing()) {

‎src/node_contextify.cc‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -292,20 +292,20 @@ ContextifyContext* ContextifyContext::New(Local<Context> v8_context,
292292
// to the ContextifyContext wrapper which in turn internally references
293293
// the context from its constructor.
294294
if (sandbox_obj.IsEmpty()) {
295-
v8_context->SetEmbedderData(ContextEmbedderIndex::kSandboxObject,
295+
v8_context->SetEmbedderDataV3(ContextEmbedderIndex::kSandboxObject,
296296
v8::Undefined(env->isolate()));
297297
} else {
298-
v8_context->SetEmbedderData(ContextEmbedderIndex::kSandboxObject,
298+
v8_context->SetEmbedderDataV3(ContextEmbedderIndex::kSandboxObject,
299299
sandbox_obj);
300300
}
301301

302302
// Delegate the code generation validation to
303303
// node::ModifyCodeGenerationFromStrings.
304304
v8_context->AllowCodeGenerationFromStrings(false);
305-
v8_context->SetEmbedderData(
305+
v8_context->SetEmbedderDataV3(
306306
ContextEmbedderIndex::kAllowCodeGenerationFromStrings,
307307
options->allow_code_gen_strings);
308-
v8_context->SetEmbedderData(ContextEmbedderIndex::kAllowWasmCodeGeneration,
308+
v8_context->SetEmbedderDataV3(ContextEmbedderIndex::kAllowWasmCodeGeneration,
309309
options->allow_code_gen_wasm);
310310

311311
Utf8Value name_val(env->isolate(), options->name);

0 commit comments

Comments
 (0)