From b5101e41bc78029f0728ec4353e7f79a6fd5fbbb Mon Sep 17 00:00:00 2001 From: Harshitha KP Date: Fri, 21 Feb 2020 05:38:53 -0500 Subject: [PATCH] src: elevate v8 namespaces PR-URL: https://github.com/nodejs/node/pull/31901 Reviewed-By: Richard Lau Reviewed-By: Michael Dawson Reviewed-By: James M Snell Reviewed-By: Gus Caplan Reviewed-By: Anna Henningsen --- src/module_wrap.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/module_wrap.cc b/src/module_wrap.cc index 736c47ec7a667d..8fb04431a7ef4c 100644 --- a/src/module_wrap.cc +++ b/src/module_wrap.cc @@ -23,6 +23,7 @@ using node::url::URL; using node::url::URL_FLAGS_FAILED; using v8::Array; using v8::Context; +using v8::EscapableHandleScope; using v8::Function; using v8::FunctionCallbackInfo; using v8::FunctionTemplate; @@ -43,6 +44,7 @@ using v8::PrimitiveArray; using v8::Promise; using v8::ScriptCompiler; using v8::ScriptOrigin; +using v8::ScriptOrModule; using v8::String; using v8::Undefined; using v8::Value; @@ -599,7 +601,7 @@ Maybe GetPackageConfig(Environment* env, std::string pkg_src = source.FromJust(); Isolate* isolate = env->isolate(); - v8::HandleScope handle_scope(isolate); + HandleScope handle_scope(isolate); Local pkg_json; { @@ -938,7 +940,7 @@ Maybe ResolveExportsTarget(Environment* env, Isolate* isolate = env->isolate(); Local context = env->context(); if (target->IsString()) { - Utf8Value target_utf8(isolate, target.As()); + Utf8Value target_utf8(isolate, target.As()); std::string target_str(*target_utf8, target_utf8.length()); Maybe resolved = ResolveExportsTargetString(env, target_str, subpath, pkg_subpath, pjson_url, base, throw_invalid); @@ -1369,12 +1371,12 @@ void ModuleWrap::GetPackageType(const FunctionCallbackInfo& args) { static MaybeLocal ImportModuleDynamically( Local context, - Local referrer, + Local referrer, Local specifier) { Isolate* iso = context->GetIsolate(); Environment* env = Environment::GetCurrent(context); CHECK_NOT_NULL(env); // TODO(addaleax): Handle nullptr here. - v8::EscapableHandleScope handle_scope(iso); + EscapableHandleScope handle_scope(iso); Local import_callback = env->host_import_module_dynamically_callback();