| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 0a949c3 commit 99371ad
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -513,9 +513,9 @@ void Worker::New(const FunctionCallbackInfo<Value>& args) { | |||
| 513 | 513 | #ifndef NODE_WITHOUT_NODE_OPTIONS | |
| 514 | 514 | MaybeLocal<String> maybe_node_opts = | |
| 515 | 515 | env_vars->Get(isolate, OneByteString(isolate, "NODE_OPTIONS")); | |
| 516 | - if (!maybe_node_opts.IsEmpty()) { | ||
| 517 | - std::string node_options( | ||
| 518 | - *String::Utf8Value(isolate, maybe_node_opts.ToLocalChecked())); | ||
| 516 | + Local<String> node_opts; | ||
| 517 | + if (maybe_node_opts.ToLocal(&node_opts)) { | ||
| 518 | + std::string node_options(*String::Utf8Value(isolate, node_opts)); | ||
| 519 | 519 | std::vector<std::string> errors{}; | |
| 520 | 520 | std::vector<std::string> env_argv = | |
| 521 | 521 | ParseNodeOptionsEnvVar(node_options, &errors); | |
@@ -555,14 +555,11 @@ void Worker::New(const FunctionCallbackInfo<Value>& args) { | |||
| 555 | 555 | if (!array->Get(env->context(), i).ToLocal(&arg)) { | |
| 556 | 556 | return; | |
| 557 | 557 | } | |
| 558 | - MaybeLocal<String> arg_v8_string = | ||
| 559 | - arg->ToString(env->context()); | ||
| 560 | - if (arg_v8_string.IsEmpty()) { | ||
| 558 | + Local<String> arg_v8; | ||
| 559 | + if (!arg->ToString(env->context()).ToLocal(&arg_v8)) { | ||
| 561 | 560 | return; | |
| 562 | 561 | } | |
| 563 | - Utf8Value arg_utf8_value( | ||
| 564 | - args.GetIsolate(), | ||
| 565 | - arg_v8_string.FromMaybe(Local<String>())); | ||
| 562 | + Utf8Value arg_utf8_value(args.GetIsolate(), arg_v8); | ||
| 566 | 563 | std::string arg_string(arg_utf8_value.out(), arg_utf8_value.length()); | |
| 567 | 564 | exec_argv.push_back(arg_string); | |
| 568 | 565 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments