Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2020-07-07 23:03:17 +0300
committerAnna Henningsen <anna@addaleax.net>2020-07-14 16:13:34 +0300
commita038199265519fa4db88a639b0e438675d23c4d1 (patch)
tree66b40d0be7e8c67e9d69593d6e00d8fd2b2ca319 /src
parent2a29650eb328417de68beb617b22e83810e9296a (diff)
src,doc,test: remove String::New default parameter
`kNormal` has been the implicit default for a while now (since V8 7.6). Refs: https://github.com/v8/v8/commit/e0d7f816990ada28ebe1281ca9431236ef8c6e4f PR-URL: https://github.com/nodejs/node/pull/34248 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/README.md4
-rw-r--r--src/api/callback.cc4
-rw-r--r--src/api/environment.cc3
-rw-r--r--src/api/exceptions.cc19
-rw-r--r--src/cares_wrap.cc5
-rw-r--r--src/heap_utils.cc11
-rw-r--r--src/node_credentials.cc4
-rw-r--r--src/node_crypto.cc7
-rw-r--r--src/node_env_var.cc3
-rw-r--r--src/node_i18n.cc3
-rw-r--r--src/node_os.cc6
-rw-r--r--src/node_perf.cc7
-rw-r--r--src/node_process_events.cc12
-rw-r--r--src/node_report_module.cc21
-rw-r--r--src/node_url.cc16
-rw-r--r--src/node_v8.cc5
-rw-r--r--src/quic/node_quic_session.cc15
-rw-r--r--src/spawn_sync.cc3
-rw-r--r--src/tls_wrap.cc2
-rw-r--r--src/util.h6
20 files changed, 47 insertions, 109 deletions
diff --git a/src/README.md b/src/README.md
index a3a6a71aa55..079326cd200 100644
--- a/src/README.md
+++ b/src/README.md
@@ -146,9 +146,7 @@ v8::Local<v8::Value> GetFoo(v8::Local<v8::Context> context,
// The 'foo_string' handle cannot be returned from this function because
// it is not “escaped” with `.Escape()`.
v8::Local<v8::String> foo_string =
- v8::String::NewFromUtf8(isolate,
- "foo",
- v8::NewStringType::kNormal).ToLocalChecked();
+ v8::String::NewFromUtf8(isolate, "foo").ToLocalChecked();
v8::Local<v8::Value> return_value;
if (obj->Get(context, foo_string).ToLocal(&return_value)) {
diff --git a/src/api/callback.cc b/src/api/callback.cc
index 2bb34b088f7..84664c08959 100644
--- a/src/api/callback.cc
+++ b/src/api/callback.cc
@@ -13,7 +13,6 @@ using v8::Isolate;
using v8::Local;
using v8::MaybeLocal;
using v8::MicrotasksScope;
-using v8::NewStringType;
using v8::Object;
using v8::String;
using v8::Value;
@@ -214,8 +213,7 @@ MaybeLocal<Value> MakeCallback(Isolate* isolate,
Local<Value> argv[],
async_context asyncContext) {
Local<String> method_string =
- String::NewFromUtf8(isolate, method, NewStringType::kNormal)
- .ToLocalChecked();
+ String::NewFromUtf8(isolate, method).ToLocalChecked();
return MakeCallback(isolate, recv, method_string, argc, argv, asyncContext);
}
diff --git a/src/api/environment.cc b/src/api/environment.cc
index 327bfb0d8d0..997c9530fc2 100644
--- a/src/api/environment.cc
+++ b/src/api/environment.cc
@@ -443,8 +443,7 @@ MaybeLocal<Value> LoadEnvironment(
// This is a slightly hacky way to convert UTF-8 to UTF-16.
Local<String> str =
String::NewFromUtf8(env->isolate(),
- main_script_source_utf8,
- v8::NewStringType::kNormal).ToLocalChecked();
+ main_script_source_utf8).ToLocalChecked();
auto main_utf16 = std::make_unique<String::Value>(env->isolate(), str);
// TODO(addaleax): Avoid having a global table for all scripts.
diff --git a/src/api/exceptions.cc b/src/api/exceptions.cc
index 998d370d3b5..310b2acc407 100644
--- a/src/api/exceptions.cc
+++ b/src/api/exceptions.cc
@@ -15,7 +15,6 @@ using v8::Exception;
using v8::Integer;
using v8::Isolate;
using v8::Local;
-using v8::NewStringType;
using v8::Object;
using v8::String;
using v8::Value;
@@ -42,8 +41,7 @@ Local<Value> ErrnoException(Isolate* isolate,
Local<String> path_string;
if (path != nullptr) {
// FIXME(bnoordhuis) It's questionable to interpret the file path as UTF-8.
- path_string = String::NewFromUtf8(isolate, path, NewStringType::kNormal)
- .ToLocalChecked();
+ path_string = String::NewFromUtf8(isolate, path).ToLocalChecked();
}
if (path_string.IsEmpty() == false) {
@@ -78,16 +76,13 @@ static Local<String> StringFromPath(Isolate* isolate, const char* path) {
return String::Concat(
isolate,
FIXED_ONE_BYTE_STRING(isolate, "\\\\"),
- String::NewFromUtf8(isolate, path + 8, NewStringType::kNormal)
- .ToLocalChecked());
+ String::NewFromUtf8(isolate, path + 8).ToLocalChecked());
} else if (strncmp(path, "\\\\?\\", 4) == 0) {
- return String::NewFromUtf8(isolate, path + 4, NewStringType::kNormal)
- .ToLocalChecked();
+ return String::NewFromUtf8(isolate, path + 4).ToLocalChecked();
}
#endif
- return String::NewFromUtf8(isolate, path, NewStringType::kNormal)
- .ToLocalChecked();
+ return String::NewFromUtf8(isolate, path).ToLocalChecked();
}
@@ -206,8 +201,7 @@ Local<Value> WinapiErrnoException(Isolate* isolate,
Local<String> cons2 = String::Concat(
isolate,
cons1,
- String::NewFromUtf8(isolate, path, NewStringType::kNormal)
- .ToLocalChecked());
+ String::NewFromUtf8(isolate, path).ToLocalChecked());
Local<String> cons3 =
String::Concat(isolate, cons2, FIXED_ONE_BYTE_STRING(isolate, "'"));
e = Exception::Error(cons3);
@@ -222,8 +216,7 @@ Local<Value> WinapiErrnoException(Isolate* isolate,
if (path != nullptr) {
obj->Set(env->context(),
env->path_string(),
- String::NewFromUtf8(isolate, path, NewStringType::kNormal)
- .ToLocalChecked())
+ String::NewFromUtf8(isolate, path).ToLocalChecked())
.Check();
}
diff --git a/src/cares_wrap.cc b/src/cares_wrap.cc
index 4a332db7127..73a0ac6b334 100644
--- a/src/cares_wrap.cc
+++ b/src/cares_wrap.cc
@@ -66,7 +66,6 @@ using v8::Int32;
using v8::Integer;
using v8::Isolate;
using v8::Local;
-using v8::NewStringType;
using v8::Null;
using v8::Object;
using v8::String;
@@ -1937,8 +1936,8 @@ void CanonicalizeIP(const FunctionCallbackInfo<Value>& args) {
char canonical_ip[INET6_ADDRSTRLEN];
const int af = (rc == 4 ? AF_INET : AF_INET6);
CHECK_EQ(0, uv_inet_ntop(af, &result, canonical_ip, sizeof(canonical_ip)));
- Local<String> val = String::NewFromUtf8(isolate, canonical_ip,
- NewStringType::kNormal).ToLocalChecked();
+ Local<String> val = String::NewFromUtf8(isolate, canonical_ip)
+ .ToLocalChecked();
args.GetReturnValue().Set(val);
}
diff --git a/src/heap_utils.cc b/src/heap_utils.cc
index 386bf61e4ec..449feb9e78d 100644
--- a/src/heap_utils.cc
+++ b/src/heap_utils.cc
@@ -118,8 +118,7 @@ class JSGraph : public EmbedderGraph {
name_str += " ";
name_str += n->Name();
}
- if (!String::NewFromUtf8(
- isolate_, name_str.c_str(), v8::NewStringType::kNormal)
+ if (!String::NewFromUtf8(isolate_, name_str.c_str())
.ToLocal(&value) ||
obj->Set(context, name_string, value).IsNothing() ||
obj->Set(context,
@@ -168,9 +167,8 @@ class JSGraph : public EmbedderGraph {
Local<Value> edge_name_value;
const char* edge_name = edge.first;
if (edge_name != nullptr) {
- if (!String::NewFromUtf8(
- isolate_, edge_name, v8::NewStringType::kNormal)
- .ToLocal(&edge_name_value)) {
+ if (!String::NewFromUtf8(isolate_, edge_name)
+ .ToLocal(&edge_name_value)) {
return MaybeLocal<Array>();
}
} else {
@@ -377,8 +375,7 @@ void TriggerHeapSnapshot(const FunctionCallbackInfo<Value>& args) {
DiagnosticFilename name(env, "Heap", "heapsnapshot");
if (!WriteSnapshot(isolate, *name))
return;
- if (String::NewFromUtf8(isolate, *name, v8::NewStringType::kNormal)
- .ToLocal(&filename_v)) {
+ if (String::NewFromUtf8(isolate, *name).ToLocal(&filename_v)) {
args.GetReturnValue().Set(filename_v);
}
return;
diff --git a/src/node_credentials.cc b/src/node_credentials.cc
index d552a501726..83db705e10d 100644
--- a/src/node_credentials.cc
+++ b/src/node_credentials.cc
@@ -20,7 +20,6 @@ using v8::HandleScope;
using v8::Isolate;
using v8::Local;
using v8::MaybeLocal;
-using v8::NewStringType;
using v8::Object;
using v8::String;
using v8::TryCatch;
@@ -46,8 +45,7 @@ bool SafeGetenv(const char* key, std::string* text, Environment* env) {
TryCatch ignore_errors(env->isolate());
MaybeLocal<String> maybe_value = env->env_vars()->Get(
env->isolate(),
- String::NewFromUtf8(env->isolate(), key, NewStringType::kNormal)
- .ToLocalChecked());
+ String::NewFromUtf8(env->isolate(), key).ToLocalChecked());
Local<String> value;
if (!maybe_value.ToLocal(&value)) goto fail;
String::Utf8Value utf8_value(env->isolate(), value);
diff --git a/src/node_crypto.cc b/src/node_crypto.cc
index eae0f2e49d3..dfc21ae6876 100644
--- a/src/node_crypto.cc
+++ b/src/node_crypto.cc
@@ -392,8 +392,7 @@ void ThrowCryptoError(Environment* env,
}
HandleScope scope(env->isolate());
Local<String> exception_string =
- String::NewFromUtf8(env->isolate(), message, NewStringType::kNormal)
- .ToLocalChecked();
+ String::NewFromUtf8(env->isolate(), message).ToLocalChecked();
CryptoErrorVector errors;
errors.Capture();
Local<Value> exception;
@@ -1017,8 +1016,8 @@ void GetRootCertificates(const FunctionCallbackInfo<Value>& args) {
for (size_t i = 0; i < arraysize(root_certs); i++) {
if (!String::NewFromOneByte(
env->isolate(),
- reinterpret_cast<const uint8_t*>(root_certs[i]),
- NewStringType::kNormal).ToLocal(&result[i])) {
+ reinterpret_cast<const uint8_t*>(root_certs[i]))
+ .ToLocal(&result[i])) {
return;
}
}
diff --git a/src/node_env_var.cc b/src/node_env_var.cc
index 23eaad48586..1a162888fd3 100644
--- a/src/node_env_var.cc
+++ b/src/node_env_var.cc
@@ -179,8 +179,7 @@ Local<Array> RealEnvStore::Enumerate(Isolate* isolate) const {
// https://github.com/libuv/libuv/pull/2473 and can be removed later.
if (items[i].name[0] == '=' || items[i].name[0] == '\0') continue;
#endif
- MaybeLocal<String> str = String::NewFromUtf8(
- isolate, items[i].name, NewStringType::kNormal);
+ MaybeLocal<String> str = String::NewFromUtf8(isolate, items[i].name);
if (str.IsEmpty()) {
isolate->ThrowException(ERR_STRING_TOO_LONG(isolate));
return Local<Array>();
diff --git a/src/node_i18n.cc b/src/node_i18n.cc
index 5382e469a40..cc2d245b8a7 100644
--- a/src/node_i18n.cc
+++ b/src/node_i18n.cc
@@ -338,8 +338,7 @@ void ICUErrorName(const FunctionCallbackInfo<Value>& args) {
UErrorCode status = static_cast<UErrorCode>(args[0].As<Int32>()->Value());
args.GetReturnValue().Set(
String::NewFromUtf8(env->isolate(),
- u_errorName(status),
- NewStringType::kNormal).ToLocalChecked());
+ u_errorName(status)).ToLocalChecked());
}
} // anonymous namespace
diff --git a/src/node_os.cc b/src/node_os.cc
index 085fb1aef01..2e151ac4f89 100644
--- a/src/node_os.cc
+++ b/src/node_os.cc
@@ -71,8 +71,7 @@ static void GetHostname(const FunctionCallbackInfo<Value>& args) {
}
args.GetReturnValue().Set(
- String::NewFromUtf8(env->isolate(), buf, NewStringType::kNormal)
- .ToLocalChecked());
+ String::NewFromUtf8(env->isolate(), buf).ToLocalChecked());
}
static void GetOSInformation(const FunctionCallbackInfo<Value>& args) {
@@ -192,8 +191,7 @@ static void GetInterfaceAddresses(const FunctionCallbackInfo<Value>& args) {
// to assume UTF8 as the default as well. It’s what people will expect if
// they name the interface from any input that uses UTF-8, which should be
// the most frequent case by far these days.)
- name = String::NewFromUtf8(isolate, raw_name,
- NewStringType::kNormal).ToLocalChecked();
+ name = String::NewFromUtf8(isolate, raw_name).ToLocalChecked();
snprintf(mac.data(),
mac.size(),
diff --git a/src/node_perf.cc b/src/node_perf.cc
index 916a9974d5d..b5efc05689f 100644
--- a/src/node_perf.cc
+++ b/src/node_perf.cc
@@ -24,7 +24,6 @@ using v8::Isolate;
using v8::Local;
using v8::Map;
using v8::MaybeLocal;
-using v8::NewStringType;
using v8::Number;
using v8::Object;
using v8::PropertyAttribute;
@@ -60,16 +59,14 @@ inline void InitObject(const PerformanceEntry& entry, Local<Object> obj) {
obj->DefineOwnProperty(context,
env->name_string(),
String::NewFromUtf8(isolate,
- entry.name().c_str(),
- NewStringType::kNormal)
+ entry.name().c_str())
.ToLocalChecked(),
attr)
.Check();
obj->DefineOwnProperty(context,
env->entry_type_string(),
String::NewFromUtf8(isolate,
- entry.type().c_str(),
- NewStringType::kNormal)
+ entry.type().c_str())
.ToLocalChecked(),
attr)
.Check();
diff --git a/src/node_process_events.cc b/src/node_process_events.cc
index 1b902949e26..0c149b26e33 100644
--- a/src/node_process_events.cc
+++ b/src/node_process_events.cc
@@ -14,7 +14,6 @@ using v8::Just;
using v8::Local;
using v8::Maybe;
using v8::MaybeLocal;
-using v8::NewStringType;
using v8::Nothing;
using v8::Object;
using v8::String;
@@ -58,21 +57,18 @@ Maybe<bool> ProcessEmitWarningGeneric(Environment* env,
// The caller has to be able to handle a failure anyway, so we might as well
// do proper error checking for string creation.
- if (!String::NewFromUtf8(env->isolate(), warning, NewStringType::kNormal)
- .ToLocal(&args[argc++])) {
+ if (!String::NewFromUtf8(env->isolate(), warning).ToLocal(&args[argc++]))
return Nothing<bool>();
- }
+
if (type != nullptr) {
if (!String::NewFromOneByte(env->isolate(),
- reinterpret_cast<const uint8_t*>(type),
- NewStringType::kNormal)
+ reinterpret_cast<const uint8_t*>(type))
.ToLocal(&args[argc++])) {
return Nothing<bool>();
}
if (code != nullptr &&
!String::NewFromOneByte(env->isolate(),
- reinterpret_cast<const uint8_t*>(code),
- NewStringType::kNormal)
+ reinterpret_cast<const uint8_t*>(code))
.ToLocal(&args[argc++])) {
return Nothing<bool>();
}
diff --git a/src/node_report_module.cc b/src/node_report_module.cc
index d9dad28221a..97c6bea3ad5 100644
--- a/src/node_report_module.cc
+++ b/src/node_report_module.cc
@@ -49,8 +49,7 @@ void WriteReport(const FunctionCallbackInfo<Value>& info) {
isolate, env, *message, *trigger, filename, error);
// Return value is the report filename
info.GetReturnValue().Set(
- String::NewFromUtf8(isolate, filename.c_str(), v8::NewStringType::kNormal)
- .ToLocalChecked());
+ String::NewFromUtf8(isolate, filename.c_str()).ToLocalChecked());
}
// External JavaScript API for returning a report
@@ -71,10 +70,8 @@ void GetReport(const FunctionCallbackInfo<Value>& info) {
isolate, env, "JavaScript API", __func__, error, out);
// Return value is the contents of a report as a string.
- info.GetReturnValue().Set(String::NewFromUtf8(isolate,
- out.str().c_str(),
- v8::NewStringType::kNormal)
- .ToLocalChecked());
+ info.GetReturnValue().Set(
+ String::NewFromUtf8(isolate, out.str().c_str()).ToLocalChecked());
}
static void GetCompact(const FunctionCallbackInfo<Value>& info) {
@@ -94,9 +91,7 @@ static void GetDirectory(const FunctionCallbackInfo<Value>& info) {
node::Mutex::ScopedLock lock(node::per_process::cli_options_mutex);
Environment* env = Environment::GetCurrent(info);
std::string directory = node::per_process::cli_options->report_directory;
- auto result = String::NewFromUtf8(env->isolate(),
- directory.c_str(),
- v8::NewStringType::kNormal);
+ auto result = String::NewFromUtf8(env->isolate(), directory.c_str());
info.GetReturnValue().Set(result.ToLocalChecked());
}
@@ -112,9 +107,7 @@ static void GetFilename(const FunctionCallbackInfo<Value>& info) {
node::Mutex::ScopedLock lock(node::per_process::cli_options_mutex);
Environment* env = Environment::GetCurrent(info);
std::string filename = node::per_process::cli_options->report_filename;
- auto result = String::NewFromUtf8(env->isolate(),
- filename.c_str(),
- v8::NewStringType::kNormal);
+ auto result = String::NewFromUtf8(env->isolate(), filename.c_str());
info.GetReturnValue().Set(result.ToLocalChecked());
}
@@ -129,9 +122,7 @@ static void SetFilename(const FunctionCallbackInfo<Value>& info) {
static void GetSignal(const FunctionCallbackInfo<Value>& info) {
Environment* env = Environment::GetCurrent(info);
std::string signal = env->isolate_data()->options()->report_signal;
- auto result = String::NewFromUtf8(env->isolate(),
- signal.c_str(),
- v8::NewStringType::kNormal);
+ auto result = String::NewFromUtf8(env->isolate(), signal.c_str());
info.GetReturnValue().Set(result.ToLocalChecked());
}
diff --git a/src/node_url.cc b/src/node_url.cc
index b1b21a8ad3c..a4549ea4b8c 100644
--- a/src/node_url.cc
+++ b/src/node_url.cc
@@ -2175,9 +2175,7 @@ void Parse(Environment* env,
Local<Value> argv[2] = { undef, undef };
argv[ERR_ARG_FLAGS] = Integer::NewFromUnsigned(isolate, url.flags);
argv[ERR_ARG_INPUT] =
- String::NewFromUtf8(env->isolate(),
- input,
- NewStringType::kNormal).ToLocalChecked();
+ String::NewFromUtf8(env->isolate(), input).ToLocalChecked();
error_cb.As<Function>()->Call(context, recv, arraysize(argv), argv)
.FromMaybe(Local<Value>());
}
@@ -2225,9 +2223,7 @@ void EncodeAuthSet(const FunctionCallbackInfo<Value>& args) {
AppendOrEscape(&output, ch, USERINFO_ENCODE_SET);
}
args.GetReturnValue().Set(
- String::NewFromUtf8(env->isolate(),
- output.c_str(),
- NewStringType::kNormal).ToLocalChecked());
+ String::NewFromUtf8(env->isolate(), output.c_str()).ToLocalChecked());
}
void ToUSVString(const FunctionCallbackInfo<Value>& args) {
@@ -2279,9 +2275,7 @@ void DomainToASCII(const FunctionCallbackInfo<Value>& args) {
}
std::string out = host.ToStringMove();
args.GetReturnValue().Set(
- String::NewFromUtf8(env->isolate(),
- out.c_str(),
- NewStringType::kNormal).ToLocalChecked());
+ String::NewFromUtf8(env->isolate(), out.c_str()).ToLocalChecked());
}
void DomainToUnicode(const FunctionCallbackInfo<Value>& args) {
@@ -2299,9 +2293,7 @@ void DomainToUnicode(const FunctionCallbackInfo<Value>& args) {
}
std::string out = host.ToStringMove();
args.GetReturnValue().Set(
- String::NewFromUtf8(env->isolate(),
- out.c_str(),
- NewStringType::kNormal).ToLocalChecked());
+ String::NewFromUtf8(env->isolate(), out.c_str()).ToLocalChecked());
}
void SetURLConstructor(const FunctionCallbackInfo<Value>& args) {
diff --git a/src/node_v8.cc b/src/node_v8.cc
index 047ca594095..f34125d5f49 100644
--- a/src/node_v8.cc
+++ b/src/node_v8.cc
@@ -37,7 +37,6 @@ using v8::HeapStatistics;
using v8::Integer;
using v8::Isolate;
using v8::Local;
-using v8::NewStringType;
using v8::Object;
using v8::ScriptCompiler;
using v8::String;
@@ -225,9 +224,7 @@ void Initialize(Local<Object> target,
MaybeStackBuffer<Local<Value>, 16> heap_spaces(number_of_heap_spaces);
for (size_t i = 0; i < number_of_heap_spaces; i++) {
env->isolate()->GetHeapSpaceStatistics(&s, i);
- heap_spaces[i] = String::NewFromUtf8(env->isolate(),
- s.space_name(),
- NewStringType::kNormal)
+ heap_spaces[i] = String::NewFromUtf8(env->isolate(), s.space_name())
.ToLocalChecked();
}
target->Set(env->context(),
diff --git a/src/quic/node_quic_session.cc b/src/quic/node_quic_session.cc
index 81f204330d1..557daa81876 100644
--- a/src/quic/node_quic_session.cc
+++ b/src/quic/node_quic_session.cc
@@ -386,16 +386,10 @@ void JSQuicSessionListener::OnClientHello(
};
if (alpn != nullptr) {
- argv[0] = String::NewFromUtf8(
- env->isolate(),
- alpn,
- v8::NewStringType::kNormal).ToLocalChecked();
+ argv[0] = String::NewFromUtf8(env->isolate(), alpn).ToLocalChecked();
}
if (server_name != nullptr) {
- argv[1] = String::NewFromUtf8(
- env->isolate(),
- server_name,
- v8::NewStringType::kNormal).ToLocalChecked();
+ argv[1] = String::NewFromUtf8(env->isolate(), server_name).ToLocalChecked();
}
// Grab a shared pointer to this to prevent the QuicSession
@@ -559,10 +553,7 @@ void JSQuicSessionListener::OnHandshakeCompleted() {
const char* hostname = ctx->servername();
if (hostname != nullptr) {
servername =
- String::NewFromUtf8(
- env->isolate(),
- hostname,
- v8::NewStringType::kNormal).ToLocalChecked();
+ String::NewFromUtf8(env->isolate(), hostname).ToLocalChecked();
}
int err = ctx->VerifyPeerIdentity(
diff --git a/src/spawn_sync.cc b/src/spawn_sync.cc
index 11126c478f7..d7d06be34bd 100644
--- a/src/spawn_sync.cc
+++ b/src/spawn_sync.cc
@@ -695,8 +695,7 @@ Local<Object> SyncProcessRunner::BuildResultObject() {
if (term_signal_ > 0)
js_result->Set(context, env()->signal_string(),
String::NewFromUtf8(env()->isolate(),
- signo_string(term_signal_),
- v8::NewStringType::kNormal)
+ signo_string(term_signal_))
.ToLocalChecked())
.Check();
else
diff --git a/src/tls_wrap.cc b/src/tls_wrap.cc
index 792d3ea79ce..04c035a1e8f 100644
--- a/src/tls_wrap.cc
+++ b/src/tls_wrap.cc
@@ -1143,7 +1143,7 @@ unsigned int TLSWrap::PskServerCallback(SSL* s,
HandleScope scope(isolate);
MaybeLocal<String> maybe_identity_str =
- v8::String::NewFromUtf8(isolate, identity, v8::NewStringType::kNormal);
+ String::NewFromUtf8(isolate, identity);
v8::Local<v8::String> identity_str;
if (!maybe_identity_str.ToLocal(&identity_str)) return 0;
diff --git a/src/util.h b/src/util.h
index 2a4d6e27d59..8b8a63adca9 100644
--- a/src/util.h
+++ b/src/util.h
@@ -686,11 +686,9 @@ inline v8::MaybeLocal<v8::Value> ToV8Value(v8::Local<v8::Context> context,
do { \
v8::Isolate* isolate = target->GetIsolate(); \
v8::Local<v8::String> constant_name = \
- v8::String::NewFromUtf8(isolate, name, v8::NewStringType::kNormal) \
- .ToLocalChecked(); \
+ v8::String::NewFromUtf8(isolate, name).ToLocalChecked(); \
v8::Local<v8::String> constant_value = \
- v8::String::NewFromUtf8(isolate, constant, v8::NewStringType::kNormal) \
- .ToLocalChecked(); \
+ v8::String::NewFromUtf8(isolate, constant).ToLocalChecked(); \
v8::PropertyAttribute constant_attributes = \
static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontDelete); \
target \