File tree Expand file tree Collapse file tree 3 files changed +6
-8
lines changed Open diff view settings
Expand file tree Collapse file tree 3 files changed +6
-8
lines changed Open diff view settings
Original file line number Diff line number Diff line change @@ -708,7 +708,9 @@ void ModuleWrap::Resolve(const FunctionCallbackInfo<Value>& args) {
708708 return node::THROW_ERR_MISSING_MODULE (env, msg.c_str ());
709709 }
710710
711- args.GetReturnValue ().Set (result.FromJust ().ToObject (env));
711+ MaybeLocal<Value> obj = result.FromJust ().ToObject (env);
712+ if (!obj.IsEmpty ())
713+ args.GetReturnValue ().Set (obj.ToLocalChecked ());
712714}
713715
714716static MaybeLocal<Promise> ImportModuleDynamically (
Original file line number Diff line number Diff line change @@ -2381,7 +2381,7 @@ URL URL::FromFilePath(const std::string& file_path) {
23812381// This function works by calling out to a JS function that creates and
23822382// returns the JS URL object. Be mindful of the JS<->Native boundary
23832383// crossing that is required.
2384- const Local <Value> URL::ToObject (Environment* env) const {
2384+ MaybeLocal <Value> URL::ToObject (Environment* env) const {
23852385 Isolate* isolate = env->isolate ();
23862386 Local<Context> context = env->context ();
23872387 Context::Scope context_scope (context);
@@ -2417,7 +2417,7 @@ const Local<Value> URL::ToObject(Environment* env) const {
24172417 ->Call (env->context (), undef, arraysize (argv), argv);
24182418 }
24192419
2420- return ret. ToLocalChecked () ;
2420+ return ret;
24212421}
24222422
24232423static void SetURLConstructor (const FunctionCallbackInfo<Value>& args) {
Original file line number Diff line number Diff line change 1111namespace node {
1212namespace url {
1313
14- using v8::Local;
15- using v8::Value;
16-
17-
1814#define PARSESTATES (XX ) \
1915 XX (kSchemeStart ) \
2016 XX (kScheme ) \
@@ -171,7 +167,7 @@ class URL {
171167 // Get the file URL from native file system path.
172168 static URL FromFilePath (const std::string& file_path);
173169
174- const Local< Value> ToObject (Environment* env) const ;
170+ v8::MaybeLocal<v8:: Value> ToObject (Environment* env) const ;
175171
176172 URL (const URL&) = default ;
177173 URL& operator =(const URL&) = default ;
You can’t perform that action at this time.
0 commit comments