diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-01-27 16:21:21 +0300 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2019-01-29 22:02:01 +0300 |
commit | 95571ac1e9acd09d0b06b2315aabb0cc4e158572 (patch) | |
tree | 67922f8c1b831d7fce0b083a3fa2d5bdd8664f51 /src/node_env_var.cc | |
parent | 4dbff090c3ff2ba43b0fbb06cc65bef5b5d81008 (diff) |
src: pass along errors from process obj instantiation
PR-URL: https://github.com/nodejs/node/pull/25734
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Diffstat (limited to 'src/node_env_var.cc')
-rw-r--r-- | src/node_env_var.cc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/node_env_var.cc b/src/node_env_var.cc index 60582d7a31c..d994a2199a5 100644 --- a/src/node_env_var.cc +++ b/src/node_env_var.cc @@ -17,6 +17,7 @@ using v8::EscapableHandleScope; using v8::Integer; using v8::Isolate; using v8::Local; +using v8::MaybeLocal; using v8::Name; using v8::NamedPropertyHandlerConfiguration; using v8::NewStringType; @@ -209,15 +210,13 @@ static void EnvEnumerator(const PropertyCallbackInfo<Array>& info) { info.GetReturnValue().Set(envarr); } -Local<Object> CreateEnvVarProxy(Local<Context> context, - Isolate* isolate, - Local<Value> data) { +MaybeLocal<Object> CreateEnvVarProxy(Local<Context> context, + Isolate* isolate, + Local<Value> data) { EscapableHandleScope scope(isolate); Local<ObjectTemplate> env_proxy_template = ObjectTemplate::New(isolate); env_proxy_template->SetHandler(NamedPropertyHandlerConfiguration( EnvGetter, EnvSetter, EnvQuery, EnvDeleter, EnvEnumerator, data)); - Local<Object> env_proxy = - env_proxy_template->NewInstance(context).ToLocalChecked(); - return scope.Escape(env_proxy); + return scope.EscapeMaybe(env_proxy_template->NewInstance(context)); } } // namespace node |