Index: src/runtime/runtime-test.cc |
diff --git a/src/runtime/runtime-test.cc b/src/runtime/runtime-test.cc |
index 2c38f12eb77c47f8606d9354d67d575f498d4e51..59b695c6f7803d74e0dd4b508d8d0aae2598ff13 100644 |
--- a/src/runtime/runtime-test.cc |
+++ b/src/runtime/runtime-test.cc |
@@ -216,11 +216,14 @@ RUNTIME_FUNCTION(Runtime_GetOptimizationCount) { |
RUNTIME_FUNCTION(Runtime_GetUndetectable) { |
HandleScope scope(isolate); |
DCHECK(args.length() == 0); |
+ v8::Isolate* v8_isolate = reinterpret_cast<v8::Isolate*>(isolate); |
- Local<v8::ObjectTemplate> desc = |
- v8::ObjectTemplate::New((v8::Isolate*)isolate); |
- desc->MarkAsUndetectable(); // undetectable |
- Local<v8::Object> obj = desc->NewInstance(); |
+ Local<v8::ObjectTemplate> desc = v8::ObjectTemplate::New(v8_isolate); |
+ desc->MarkAsUndetectable(); |
+ Local<v8::Object> obj; |
+ if (!desc->NewInstance(v8_isolate->GetCurrentContext()).ToLocal(&obj)) { |
+ return nullptr; |
+ } |
return *Utils::OpenHandle(*obj); |
} |