Skip to content

Commit b5101e4

Browse files
HarshithaKPcodebytere
authored andcommitted
src: elevate v8 namespaces
PR-URL: #31901 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Anna Henningsen <anna@addaleax.net>
1 parent d70f052 commit b5101e4

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/module_wrap.cc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ using node::url::URL;
2323
using node::url::URL_FLAGS_FAILED;
2424
using v8::Array;
2525
using v8::Context;
26+
using v8::EscapableHandleScope;
2627
using v8::Function;
2728
using v8::FunctionCallbackInfo;
2829
using v8::FunctionTemplate;
@@ -43,6 +44,7 @@ using v8::PrimitiveArray;
4344
using v8::Promise;
4445
using v8::ScriptCompiler;
4546
using v8::ScriptOrigin;
47+
using v8::ScriptOrModule;
4648
using v8::String;
4749
using v8::Undefined;
4850
using v8::Value;
@@ -599,7 +601,7 @@ Maybe<const PackageConfig*> GetPackageConfig(Environment* env,
599601
std::string pkg_src = source.FromJust();
600602

601603
Isolate* isolate = env->isolate();
602-
v8::HandleScope handle_scope(isolate);
604+
HandleScope handle_scope(isolate);
603605

604606
Local<Object> pkg_json;
605607
{
@@ -938,7 +940,7 @@ Maybe<URL> ResolveExportsTarget(Environment* env,
938940
Isolate* isolate = env->isolate();
939941
Local<Context> context = env->context();
940942
if (target->IsString()) {
941-
Utf8Value target_utf8(isolate, target.As<v8::String>());
943+
Utf8Value target_utf8(isolate, target.As<String>());
942944
std::string target_str(*target_utf8, target_utf8.length());
943945
Maybe<URL> resolved = ResolveExportsTargetString(env, target_str, subpath,
944946
pkg_subpath, pjson_url, base, throw_invalid);
@@ -1369,12 +1371,12 @@ void ModuleWrap::GetPackageType(const FunctionCallbackInfo<Value>& args) {
13691371

13701372
static MaybeLocal<Promise> ImportModuleDynamically(
13711373
Local<Context> context,
1372-
Local<v8::ScriptOrModule> referrer,
1374+
Local<ScriptOrModule> referrer,
13731375
Local<String> specifier) {
13741376
Isolate* iso = context->GetIsolate();
13751377
Environment* env = Environment::GetCurrent(context);
13761378
CHECK_NOT_NULL(env); // TODO(addaleax): Handle nullptr here.
1377-
v8::EscapableHandleScope handle_scope(iso);
1379+
EscapableHandleScope handle_scope(iso);
13781380

13791381
Local<Function> import_callback =
13801382
env->host_import_module_dynamically_callback();

0 commit comments

Comments
 (0)