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/api | |
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/api')
-rw-r--r-- | src/api/callback.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/api/callback.cc b/src/api/callback.cc index a7b23dd4924..f8bf9170596 100644 --- a/src/api/callback.cc +++ b/src/api/callback.cc @@ -223,7 +223,8 @@ MaybeLocal<Value> MakeCallback(Isolate* isolate, Local<Value> argv[], async_context asyncContext) { // Check can_call_into_js() first because calling Get() might do so. - Environment* env = Environment::GetCurrent(recv->CreationContext()); + Environment* env = + Environment::GetCurrent(recv->GetCreationContext().ToLocalChecked()); CHECK_NOT_NULL(env); if (!env->can_call_into_js()) return Local<Value>(); @@ -252,7 +253,8 @@ MaybeLocal<Value> MakeCallback(Isolate* isolate, // // Because of the AssignToContext() call in src/node_contextify.cc, // the two contexts need not be the same. - Environment* env = Environment::GetCurrent(callback->CreationContext()); + Environment* env = + Environment::GetCurrent(callback->GetCreationContext().ToLocalChecked()); CHECK_NOT_NULL(env); Context::Scope context_scope(env->context()); MaybeLocal<Value> ret = @@ -274,7 +276,8 @@ MaybeLocal<Value> MakeSyncCallback(Isolate* isolate, Local<Function> callback, int argc, Local<Value> argv[]) { - Environment* env = Environment::GetCurrent(callback->CreationContext()); + Environment* env = + Environment::GetCurrent(callback->GetCreationContext().ToLocalChecked()); CHECK_NOT_NULL(env); if (!env->can_call_into_js()) return Local<Value>(); |