Index: src/runtime/runtime-debug.cc |
diff --git a/src/runtime/runtime-debug.cc b/src/runtime/runtime-debug.cc |
index 9a54a824ca2a16659208b9b50040261a65f1c1d7..61780055f1ae389a5c138d33db85ddfdbdcb7de7 100644 |
--- a/src/runtime/runtime-debug.cc |
+++ b/src/runtime/runtime-debug.cc |
@@ -1294,10 +1294,7 @@ RUNTIME_FUNCTION(Runtime_DebugGetLoadedScripts) { |
} |
// Return result as a JS array. |
- Handle<JSObject> result = |
- isolate->factory()->NewJSObject(isolate->array_function()); |
- JSArray::SetContent(Handle<JSArray>::cast(result), instances); |
- return *result; |
+ return *isolate->factory()->NewJSArrayWithElements(instances); |
} |
static bool HasInPrototypeChainIgnoringProxies(Isolate* isolate, |