diff --git a/src/node_worker.cc b/src/node_worker.cc index f7d5434efd9e7c..403c054ab21e77 100644 --- a/src/node_worker.cc +++ b/src/node_worker.cc @@ -487,9 +487,9 @@ void Worker::New(const FunctionCallbackInfo& args) { #ifndef NODE_WITHOUT_NODE_OPTIONS MaybeLocal maybe_node_opts = env_vars->Get(isolate, OneByteString(isolate, "NODE_OPTIONS")); - if (!maybe_node_opts.IsEmpty()) { - std::string node_options( - *String::Utf8Value(isolate, maybe_node_opts.ToLocalChecked())); + Local node_opts; + if (maybe_node_opts.ToLocal(&node_opts)) { + std::string node_options(*String::Utf8Value(isolate, node_opts)); std::vector errors{}; std::vector env_argv = ParseNodeOptionsEnvVar(node_options, &errors); @@ -529,14 +529,11 @@ void Worker::New(const FunctionCallbackInfo& args) { if (!array->Get(env->context(), i).ToLocal(&arg)) { return; } - MaybeLocal arg_v8_string = - arg->ToString(env->context()); - if (arg_v8_string.IsEmpty()) { + Local arg_v8; + if (!arg->ToString(env->context()).ToLocal(&arg_v8)) { return; } - Utf8Value arg_utf8_value( - args.GetIsolate(), - arg_v8_string.FromMaybe(Local())); + Utf8Value arg_utf8_value(args.GetIsolate(), arg_v8); std::string arg_string(arg_utf8_value.out(), arg_utf8_value.length()); exec_argv.push_back(arg_string); }