Skip to content

Commit 9f68e14

Browse files
HarshithaKPcodebytere
authored andcommittedFeb 27, 2020
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 a468392 commit 9f68e14

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed
 

‎src/module_wrap.cc

+7-5
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ using node::url::URL_FLAGS_FAILED;
2525
using v8::Array;
2626
using v8::ArrayBufferView;
2727
using v8::Context;
28+
using v8::EscapableHandleScope;
2829
using v8::Function;
2930
using v8::FunctionCallbackInfo;
3031
using v8::FunctionTemplate;
@@ -45,6 +46,7 @@ using v8::PrimitiveArray;
4546
using v8::Promise;
4647
using v8::ScriptCompiler;
4748
using v8::ScriptOrigin;
49+
using v8::ScriptOrModule;
4850
using v8::String;
4951
using v8::UnboundModuleScript;
5052
using v8::Undefined;
@@ -627,7 +629,7 @@ Maybe<const PackageConfig*> GetPackageConfig(Environment* env,
627629
std::string pkg_src = source.FromJust();
628630

629631
Isolate* isolate = env->isolate();
630-
v8::HandleScope handle_scope(isolate);
632+
HandleScope handle_scope(isolate);
631633

632634
Local<Object> pkg_json;
633635
{
@@ -899,7 +901,7 @@ void ThrowExportsInvalid(Environment* env,
899901
const URL& base) {
900902
Local<String> target_string;
901903
if (target->IsObject()) {
902-
if (!v8::JSON::Stringify(env->context(), target.As<v8::Object>(),
904+
if (!v8::JSON::Stringify(env->context(), target.As<Object>(),
903905
v8::String::Empty(env->isolate())).ToLocal(&target_string))
904906
return;
905907
} else {
@@ -977,7 +979,7 @@ Maybe<URL> ResolveExportsTarget(Environment* env,
977979
Isolate* isolate = env->isolate();
978980
Local<Context> context = env->context();
979981
if (target->IsString()) {
980-
Utf8Value target_utf8(isolate, target.As<v8::String>());
982+
Utf8Value target_utf8(isolate, target.As<String>());
981983
std::string target_str(*target_utf8, target_utf8.length());
982984
Maybe<URL> resolved = ResolveExportsTargetString(env, target_str, subpath,
983985
pkg_subpath, pjson_url, base);
@@ -1440,12 +1442,12 @@ void ModuleWrap::GetPackageType(const FunctionCallbackInfo<Value>& args) {
14401442

14411443
static MaybeLocal<Promise> ImportModuleDynamically(
14421444
Local<Context> context,
1443-
Local<v8::ScriptOrModule> referrer,
1445+
Local<ScriptOrModule> referrer,
14441446
Local<String> specifier) {
14451447
Isolate* iso = context->GetIsolate();
14461448
Environment* env = Environment::GetCurrent(context);
14471449
CHECK_NOT_NULL(env); // TODO(addaleax): Handle nullptr here.
1448-
v8::EscapableHandleScope handle_scope(iso);
1450+
EscapableHandleScope handle_scope(iso);
14491451

14501452
Local<Function> import_callback =
14511453
env->host_import_module_dynamically_callback();

0 commit comments

Comments
 (0)
Please sign in to comment.