Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src/api
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2021-02-28 19:45:24 +0300
committerMichaël Zasso <targos@protonmail.com>2021-03-15 17:56:25 +0300
commit8e8dea36cc98050371bdc2a3c462399b78a6c0f2 (patch)
treead54fa524a95351ffb642041b47ab3c7ae09b509 /src/api
parentb1c1c4695ca246e8421341d7d7616100a4e91791 (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.cc9
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>();