diff options
author | Tobias Nießen <tniessen@tnie.de> | 2017-07-31 03:05:20 +0300 |
---|---|---|
committer | Tobias Nießen <tniessen@tnie.de> | 2017-08-02 13:03:21 +0300 |
commit | 98bae2930453d40dadf3f36f5ad89eb73b23ef3a (patch) | |
tree | fa8ea40252276f4ebb90cc31085f7e50732d648f /src/js_stream.cc | |
parent | 1c362436b750c714f8d83f4d47fe7e25d252c96b (diff) |
src: return MaybeLocal in AsyncWrap::MakeCallback
PR-URL: https://github.com/nodejs/node/pull/14549
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'src/js_stream.cc')
-rw-r--r-- | src/js_stream.cc | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/js_stream.cc b/src/js_stream.cc index 2644a6a451a..d88cc853c80 100644 --- a/src/js_stream.cc +++ b/src/js_stream.cc @@ -16,6 +16,7 @@ using v8::FunctionCallbackInfo; using v8::FunctionTemplate; using v8::HandleScope; using v8::Local; +using v8::MaybeLocal; using v8::Object; using v8::Value; @@ -46,22 +47,26 @@ bool JSStream::IsAlive() { v8::Local<v8::Value> fn = object()->Get(env()->isalive_string()); if (!fn->IsFunction()) return false; - return MakeCallback(fn.As<v8::Function>(), 0, nullptr)->IsTrue(); + return MakeCallback(fn.As<v8::Function>(), 0, nullptr) + .ToLocalChecked()->IsTrue(); } bool JSStream::IsClosing() { - return MakeCallback(env()->isclosing_string(), 0, nullptr)->IsTrue(); + return MakeCallback(env()->isclosing_string(), 0, nullptr) + .ToLocalChecked()->IsTrue(); } int JSStream::ReadStart() { - return MakeCallback(env()->onreadstart_string(), 0, nullptr)->Int32Value(); + return MakeCallback(env()->onreadstart_string(), 0, nullptr) + .ToLocalChecked()->Int32Value(); } int JSStream::ReadStop() { - return MakeCallback(env()->onreadstop_string(), 0, nullptr)->Int32Value(); + return MakeCallback(env()->onreadstop_string(), 0, nullptr) + .ToLocalChecked()->Int32Value(); } @@ -73,10 +78,10 @@ int JSStream::DoShutdown(ShutdownWrap* req_wrap) { }; req_wrap->Dispatched(); - Local<Value> res = + MaybeLocal<Value> res = MakeCallback(env()->onshutdown_string(), arraysize(argv), argv); - return res->Int32Value(); + return res.ToLocalChecked()->Int32Value(); } @@ -101,10 +106,10 @@ int JSStream::DoWrite(WriteWrap* w, }; w->Dispatched(); - Local<Value> res = + MaybeLocal<Value> res = MakeCallback(env()->onwrite_string(), arraysize(argv), argv); - return res->Int32Value(); + return res.ToLocalChecked()->Int32Value(); } |