Index: src/extensions/statistics-extension.cc |
diff --git a/src/extensions/statistics-extension.cc b/src/extensions/statistics-extension.cc |
index d1bb0918403f6c02ca0983d1a723bac5432ac30d..7093625270ee35ac1d087bd0c222bc038a289cef 100644 |
--- a/src/extensions/statistics-extension.cc |
+++ b/src/extensions/statistics-extension.cc |
@@ -24,8 +24,11 @@ static void AddCounter(v8::Isolate* isolate, |
StatsCounter* counter, |
const char* name) { |
if (counter->Enabled()) { |
- object->Set(v8::String::NewFromUtf8(isolate, name), |
- v8::Number::New(isolate, *counter->GetInternalPointer())); |
+ object->Set(isolate->GetCurrentContext(), |
+ v8::String::NewFromUtf8(isolate, name, NewStringType::kNormal) |
+ .ToLocalChecked(), |
+ v8::Number::New(isolate, *counter->GetInternalPointer())) |
+ .FromJust(); |
} |
} |
@@ -33,8 +36,10 @@ static void AddNumber(v8::Isolate* isolate, |
v8::Local<v8::Object> object, |
intptr_t value, |
const char* name) { |
- object->Set(v8::String::NewFromUtf8(isolate, name), |
- v8::Number::New(isolate, static_cast<double>(value))); |
+ object->Set(isolate->GetCurrentContext(), |
+ v8::String::NewFromUtf8(isolate, name, NewStringType::kNormal) |
+ .ToLocalChecked(), |
+ v8::Number::New(isolate, static_cast<double>(value))).FromJust(); |
} |
@@ -42,8 +47,10 @@ static void AddNumber64(v8::Isolate* isolate, |
v8::Local<v8::Object> object, |
int64_t value, |
const char* name) { |
- object->Set(v8::String::NewFromUtf8(isolate, name), |
- v8::Number::New(isolate, static_cast<double>(value))); |
+ object->Set(isolate->GetCurrentContext(), |
+ v8::String::NewFromUtf8(isolate, name, NewStringType::kNormal) |
+ .ToLocalChecked(), |
+ v8::Number::New(isolate, static_cast<double>(value))).FromJust(); |
} |
@@ -54,7 +61,9 @@ void StatisticsExtension::GetCounters( |
if (args.Length() > 0) { // GC if first argument evaluates to true. |
if (args[0]->IsBoolean() && |
- args[0]->ToBoolean(args.GetIsolate())->Value()) { |
+ args[0] |
+ ->BooleanValue(args.GetIsolate()->GetCurrentContext()) |
+ .FromMaybe(false)) { |
heap->CollectAllGarbage(Heap::kNoGCFlags, "counters extension"); |
} |
} |