diff options
author | Daniel Bevenius <daniel.bevenius@gmail.com> | 2018-11-08 09:22:13 +0300 |
---|---|---|
committer | Daniel Bevenius <daniel.bevenius@gmail.com> | 2018-11-11 10:02:30 +0300 |
commit | 344d33eef110486bc094ba8d97a483379bf62752 (patch) | |
tree | 9d929c9fc5a77665f6a5b13defc2b9e0c8c19af3 /src/node_v8.cc | |
parent | 19e5e78e9c65605eba43b8c506a8069f6f6d5ff9 (diff) |
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_v8.cc')
-rw-r--r-- | src/node_v8.cc | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/src/node_v8.cc b/src/node_v8.cc index 2a661d95497..ab453134fab 100644 --- a/src/node_v8.cc +++ b/src/node_v8.cc @@ -134,23 +134,27 @@ void Initialize(Local<Object> target, const size_t heap_statistics_buffer_byte_length = sizeof(*env->heap_statistics_buffer()) * kHeapStatisticsPropertiesCount; - target->Set(FIXED_ONE_BYTE_STRING(env->isolate(), + target->Set(env->context(), + FIXED_ONE_BYTE_STRING(env->isolate(), "heapStatisticsArrayBuffer"), ArrayBuffer::New(env->isolate(), env->heap_statistics_buffer(), - heap_statistics_buffer_byte_length)); + heap_statistics_buffer_byte_length)).FromJust(); #define V(i, _, name) \ - target->Set(FIXED_ONE_BYTE_STRING(env->isolate(), #name), \ - Uint32::NewFromUnsigned(env->isolate(), i)); + target->Set(env->context(), \ + FIXED_ONE_BYTE_STRING(env->isolate(), #name), \ + Uint32::NewFromUnsigned(env->isolate(), i)).FromJust(); HEAP_STATISTICS_PROPERTIES(V) #undef V - target->Set(FIXED_ONE_BYTE_STRING(env->isolate(), + target->Set(env->context(), + FIXED_ONE_BYTE_STRING(env->isolate(), "kHeapSpaceStatisticsPropertiesCount"), Uint32::NewFromUnsigned(env->isolate(), - kHeapSpaceStatisticsPropertiesCount)); + kHeapSpaceStatisticsPropertiesCount)) + .FromJust(); size_t number_of_heap_spaces = env->isolate()->NumberOfHeapSpaces(); @@ -165,10 +169,11 @@ void Initialize(Local<Object> target, s.space_name(), NewStringType::kNormal) .ToLocalChecked(); - heap_spaces->Set(i, heap_space_name); + heap_spaces->Set(env->context(), i, heap_space_name).FromJust(); } - target->Set(FIXED_ONE_BYTE_STRING(env->isolate(), "kHeapSpaces"), - heap_spaces); + target->Set(env->context(), + FIXED_ONE_BYTE_STRING(env->isolate(), "kHeapSpaces"), + heap_spaces).FromJust(); env->SetMethod(target, "updateHeapSpaceStatisticsArrayBuffer", @@ -182,15 +187,18 @@ void Initialize(Local<Object> target, kHeapSpaceStatisticsPropertiesCount * number_of_heap_spaces; - target->Set(FIXED_ONE_BYTE_STRING(env->isolate(), + target->Set(env->context(), + FIXED_ONE_BYTE_STRING(env->isolate(), "heapSpaceStatisticsArrayBuffer"), ArrayBuffer::New(env->isolate(), env->heap_space_statistics_buffer(), - heap_space_statistics_buffer_byte_length)); + heap_space_statistics_buffer_byte_length)) + .FromJust(); #define V(i, _, name) \ - target->Set(FIXED_ONE_BYTE_STRING(env->isolate(), #name), \ - Uint32::NewFromUnsigned(env->isolate(), i)); + target->Set(env->context(), \ + FIXED_ONE_BYTE_STRING(env->isolate(), #name), \ + Uint32::NewFromUnsigned(env->isolate(), i)).FromJust(); HEAP_SPACE_STATISTICS_PROPERTIES(V) #undef V |