summaryrefslogtreecommitdiff
path: root/src/node_util.cc
diff options
context:
space:
mode:
authorDaniel Bevenius <daniel.bevenius@gmail.com>2018-11-08 07:22:13 +0100
committerDaniel Bevenius <daniel.bevenius@gmail.com>2018-11-11 08:02:30 +0100
commit344d33eef110486bc094ba8d97a483379bf62752 (patch)
tree9d929c9fc5a77665f6a5b13defc2b9e0c8c19af3 /src/node_util.cc
parent19e5e78e9c65605eba43b8c506a8069f6f6d5ff9 (diff)
downloadandroid-node-v8-344d33eef110486bc094ba8d97a483379bf62752.tar.gz
android-node-v8-344d33eef110486bc094ba8d97a483379bf62752.tar.bz2
android-node-v8-344d33eef110486bc094ba8d97a483379bf62752.zip
src: fix v8 compiler warnings in src
This commit changes the code to use the maybe version. PR-URL: https://github.com/nodejs/node/pull/24246 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Refael Ackermann <refack@gmail.com>
Diffstat (limited to 'src/node_util.cc')
-rw-r--r--src/node_util.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/node_util.cc b/src/node_util.cc
index ac39be407d..62af7a1115 100644
--- a/src/node_util.cc
+++ b/src/node_util.cc
@@ -57,6 +57,7 @@ static void GetOwnNonIndexProperties(
}
static void GetPromiseDetails(const FunctionCallbackInfo<Value>& args) {
+ Environment* env = Environment::GetCurrent(args);
// Return undefined if it's not a Promise.
if (!args[0]->IsPromise())
return;
@@ -67,14 +68,15 @@ static void GetPromiseDetails(const FunctionCallbackInfo<Value>& args) {
Local<Array> ret = Array::New(isolate, 2);
int state = promise->State();
- ret->Set(0, Integer::New(isolate, state));
+ ret->Set(env->context(), 0, Integer::New(isolate, state)).FromJust();
if (state != Promise::PromiseState::kPending)
- ret->Set(1, promise->Result());
+ ret->Set(env->context(), 1, promise->Result()).FromJust();
args.GetReturnValue().Set(ret);
}
static void GetProxyDetails(const FunctionCallbackInfo<Value>& args) {
+ Environment* env = Environment::GetCurrent(args);
// Return undefined if it's not a proxy.
if (!args[0]->IsProxy())
return;
@@ -82,8 +84,8 @@ static void GetProxyDetails(const FunctionCallbackInfo<Value>& args) {
Local<Proxy> proxy = args[0].As<Proxy>();
Local<Array> ret = Array::New(args.GetIsolate(), 2);
- ret->Set(0, proxy->GetTarget());
- ret->Set(1, proxy->GetHandler());
+ ret->Set(env->context(), 0, proxy->GetTarget()).FromJust();
+ ret->Set(env->context(), 1, proxy->GetHandler()).FromJust();
args.GetReturnValue().Set(ret);
}