From 8c48302a50d92777bc63d378f7e354d7f38baf5d Mon Sep 17 00:00:00 2001 From: Jayasankar Date: Fri, 23 Nov 2018 06:26:31 +0530 Subject: [PATCH] src: elevate v8 namespaces for node_url.cc Elevate namespace for repeated entities. PR-URL: https://github.com/nodejs/node/pull/24573 Reviewed-By: Anna Henningsen Reviewed-By: Joyee Cheung Reviewed-By: Luigi Pinca Reviewed-By: Colin Ihrig Reviewed-By: Trivikram Kamat --- src/node_url.cc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/node_url.cc b/src/node_url.cc index f0278a5cf3d20b..94aba9e2e8356f 100644 --- a/src/node_url.cc +++ b/src/node_url.cc @@ -20,6 +20,7 @@ using v8::Integer; using v8::Isolate; using v8::Local; using v8::MaybeLocal; +using v8::NewStringType; using v8::Null; using v8::Object; using v8::String; @@ -30,7 +31,7 @@ using v8::Value; inline Local Utf8String(Isolate* isolate, const std::string& str) { return String::NewFromUtf8(isolate, str.data(), - v8::NewStringType::kNormal, + NewStringType::kNormal, str.length()).ToLocalChecked(); } @@ -2158,7 +2159,7 @@ static void Parse(Environment* env, argv[ERR_ARG_INPUT] = String::NewFromUtf8(env->isolate(), input, - v8::NewStringType::kNormal).ToLocalChecked(); + NewStringType::kNormal).ToLocalChecked(); error_cb.As()->Call(context, recv, arraysize(argv), argv) .FromMaybe(Local()); } @@ -2208,7 +2209,7 @@ static void EncodeAuthSet(const FunctionCallbackInfo& args) { args.GetReturnValue().Set( String::NewFromUtf8(env->isolate(), output.c_str(), - v8::NewStringType::kNormal).ToLocalChecked()); + NewStringType::kNormal).ToLocalChecked()); } static void ToUSVString(const FunctionCallbackInfo& args) { @@ -2242,7 +2243,7 @@ static void ToUSVString(const FunctionCallbackInfo& args) { args.GetReturnValue().Set( String::NewFromTwoByte(env->isolate(), *value, - v8::NewStringType::kNormal, + NewStringType::kNormal, n).ToLocalChecked()); } @@ -2263,7 +2264,7 @@ static void DomainToASCII(const FunctionCallbackInfo& args) { args.GetReturnValue().Set( String::NewFromUtf8(env->isolate(), out.c_str(), - v8::NewStringType::kNormal).ToLocalChecked()); + NewStringType::kNormal).ToLocalChecked()); } static void DomainToUnicode(const FunctionCallbackInfo& args) { @@ -2283,7 +2284,7 @@ static void DomainToUnicode(const FunctionCallbackInfo& args) { args.GetReturnValue().Set( String::NewFromUtf8(env->isolate(), out.c_str(), - v8::NewStringType::kNormal).ToLocalChecked()); + NewStringType::kNormal).ToLocalChecked()); } std::string URL::ToFilePath() const {