diff options
author | Michaël Zasso <targos@protonmail.com> | 2021-02-28 19:45:24 +0300 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2021-03-15 17:56:25 +0300 |
commit | 8e8dea36cc98050371bdc2a3c462399b78a6c0f2 (patch) | |
tree | ad54fa524a95351ffb642041b47ab3c7ae09b509 /src/module_wrap.cc | |
parent | b1c1c4695ca246e8421341d7d7616100a4e91791 (diff) |
src: use non-deprecated GetCreationContext from V8
Fixes: https://github.com/nodejs/node-v8/issues/193
PR-URL: https://github.com/nodejs/node/pull/37587
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Diffstat (limited to 'src/module_wrap.cc')
-rw-r--r-- | src/module_wrap.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/module_wrap.cc b/src/module_wrap.cc index 532d7382dfd..d33cb19b3dc 100644 --- a/src/module_wrap.cc +++ b/src/module_wrap.cc @@ -83,7 +83,7 @@ ModuleWrap::~ModuleWrap() { Local<Context> ModuleWrap::context() const { Local<Value> obj = object()->GetInternalField(kContextObjectSlot); if (obj.IsEmpty()) return {}; - return obj.As<Object>()->CreationContext(); + return obj.As<Object>()->GetCreationContext().ToLocalChecked(); } ModuleWrap* ModuleWrap::GetFromModule(Environment* env, @@ -122,7 +122,7 @@ void ModuleWrap::New(const FunctionCallbackInfo<Value>& args) { Local<Context> context; ContextifyContext* contextify_context = nullptr; if (args[1]->IsUndefined()) { - context = that->CreationContext(); + context = that->GetCreationContext().ToLocalChecked(); } else { CHECK(args[1]->IsObject()); contextify_context = ContextifyContext::ContextFromContextifiedSandbox( @@ -237,7 +237,7 @@ void ModuleWrap::New(const FunctionCallbackInfo<Value>& args) { obj->object()->SetInternalField(kSyntheticEvaluationStepsSlot, args[3]); } - // Use the extras object as an object whose CreationContext() will be the + // Use the extras object as an object whose GetCreationContext() will be the // original `context`, since the `Context` itself strictly speaking cannot // be stored in an internal field. obj->object()->SetInternalField(kContextObjectSlot, |