diff --git a/src/js_native_api_v8.cc b/src/js_native_api_v8.cc index 0a3494ce700c93..64e4298e122f43 100644 --- a/src/js_native_api_v8.cc +++ b/src/js_native_api_v8.cc @@ -169,7 +169,7 @@ inline static napi_status ConcludeDeferred(napi_env env, NAPI_PREAMBLE(env); CHECK_ARG(env, result); - v8::Local context = env->isolate->GetCurrentContext(); + v8::Local context = env->context(); v8impl::Persistent* deferred_ref = NodePersistentFromJsDeferred(deferred); v8::Local v8_deferred = @@ -385,8 +385,7 @@ inline static napi_status Unwrap(napi_env env, CHECK_ARG(env, result); } - v8::Isolate* isolate = env->isolate; - v8::Local context = isolate->GetCurrentContext(); + v8::Local context = env->context(); v8::Local value = v8impl::V8LocalValueFromJsValue(js_object); RETURN_STATUS_IF_FALSE(env, value->IsObject(), napi_invalid_arg);