| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -708,7 +708,9 @@ void ModuleWrap::Resolve(const FunctionCallbackInfo<Value>& args) { | |||
| 708 | 708 | return node::THROW_ERR_MISSING_MODULE(env, msg.c_str()); | |
| 709 | 709 | } | |
| 710 | 710 | ||
| 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()); | ||
| 712 | 714 | } | |
| 713 | 715 | ||
| 714 | 716 | static 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) { | |||
| 2381 | 2381 | // This function works by calling out to a JS function that creates and | |
| 2382 | 2382 | // returns the JS URL object. Be mindful of the JS<->Native boundary | |
| 2383 | 2383 | // crossing that is required. | |
| 2384 | - const Local<Value> URL::ToObject(Environment* env) const { | ||
| 2384 | + MaybeLocal<Value> URL::ToObject(Environment* env) const { | ||
| 2385 | 2385 | Isolate* isolate = env->isolate(); | |
| 2386 | 2386 | Local<Context> context = env->context(); | |
| 2387 | 2387 | Context::Scope context_scope(context); | |
@@ -2417,7 +2417,7 @@ const Local<Value> URL::ToObject(Environment* env) const { | |||
| 2417 | 2417 | ->Call(env->context(), undef, arraysize(argv), argv); | |
| 2418 | 2418 | } | |
| 2419 | 2419 | ||
| 2420 | - return ret.ToLocalChecked(); | ||
| 2420 | + return ret; | ||
| 2421 | 2421 | } | |
| 2422 | 2422 | ||
| 2423 | 2423 | static void SetURLConstructor(const FunctionCallbackInfo<Value>& args) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -11,10 +11,6 @@ | |||
| 11 | 11 | namespace node { | |
| 12 | 12 | namespace url { | |
| 13 | 13 | ||
| 14 | - using v8::Local; | ||
| 15 | - using v8::Value; | ||
| 16 | - | ||
| 17 | - | ||
| 18 | 14 | #define PARSESTATES(XX) \ | |
| 19 | 15 | XX(kSchemeStart) \ | |
| 20 | 16 | XX(kScheme) \ | |
@@ -171,7 +167,7 @@ class URL { | |||
| 171 | 167 | // Get the file URL from native file system path. | |
| 172 | 168 | static URL FromFilePath(const std::string& file_path); | |
| 173 | 169 | ||
| 174 | - const Local<Value> ToObject(Environment* env) const; | ||
| 170 | + v8::MaybeLocal<v8::Value> ToObject(Environment* env) const; | ||
| 175 | 171 | ||
| 176 | 172 | URL(const URL&) = default; | |
| 177 | 173 | URL& operator=(const URL&) = default; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments