diff options
author | Daniel Bevenius <daniel.bevenius@gmail.com> | 2018-11-08 07:22:13 +0100 |
---|---|---|
committer | Daniel Bevenius <daniel.bevenius@gmail.com> | 2018-11-11 08:02:30 +0100 |
commit | 344d33eef110486bc094ba8d97a483379bf62752 (patch) | |
tree | 9d929c9fc5a77665f6a5b13defc2b9e0c8c19af3 /src/node_contextify.cc | |
parent | 19e5e78e9c65605eba43b8c506a8069f6f6d5ff9 (diff) | |
download | android-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_contextify.cc')
-rw-r--r-- | src/node_contextify.cc | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/node_contextify.cc b/src/node_contextify.cc index e878507731..37afead808 100644 --- a/src/node_contextify.cc +++ b/src/node_contextify.cc @@ -392,7 +392,7 @@ void ContextifyContext::PropertySetterCallback( args.GetReturnValue().Set(false); } - ctx->sandbox()->Set(property, value); + ctx->sandbox()->Set(ctx->context(), property, value).FromJust(); } // static @@ -606,8 +606,8 @@ void ContextifyScript::Init(Environment* env, Local<Object> target) { env->SetProtoMethod(script_tmpl, "runInContext", RunInContext); env->SetProtoMethod(script_tmpl, "runInThisContext", RunInThisContext); - target->Set(class_name, - script_tmpl->GetFunction(env->context()).ToLocalChecked()); + target->Set(env->context(), class_name, + script_tmpl->GetFunction(env->context()).ToLocalChecked()).FromJust(); env->set_script_context_constructor_template(script_tmpl); } @@ -728,8 +728,9 @@ void ContextifyScript::New(const FunctionCallbackInfo<Value>& args) { if (compile_options == ScriptCompiler::kConsumeCodeCache) { args.This()->Set( + env->context(), env->cached_data_rejected_string(), - Boolean::New(isolate, source.GetCachedData()->rejected)); + Boolean::New(isolate, source.GetCachedData()->rejected)).FromJust(); } else if (produce_cached_data) { const ScriptCompiler::CachedData* cached_data = ScriptCompiler::CreateCodeCache(v8_script.ToLocalChecked()); @@ -739,11 +740,14 @@ void ContextifyScript::New(const FunctionCallbackInfo<Value>& args) { env, reinterpret_cast<const char*>(cached_data->data), cached_data->length); - args.This()->Set(env->cached_data_string(), buf.ToLocalChecked()); + args.This()->Set(env->context(), + env->cached_data_string(), + buf.ToLocalChecked()).FromJust(); } args.This()->Set( + env->context(), env->cached_data_produced_string(), - Boolean::New(isolate, cached_data_produced)); + Boolean::New(isolate, cached_data_produced)).FromJust(); } TRACE_EVENT_NESTABLE_ASYNC_END0( TRACING_CATEGORY_NODE2(vm, script), |