diff options
Diffstat (limited to 'Libraries/LibJS/Runtime/ObjectConstructor.cpp')
-rw-r--r-- | Libraries/LibJS/Runtime/ObjectConstructor.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Libraries/LibJS/Runtime/ObjectConstructor.cpp b/Libraries/LibJS/Runtime/ObjectConstructor.cpp index f660df2bb9..aa54de74b9 100644 --- a/Libraries/LibJS/Runtime/ObjectConstructor.cpp +++ b/Libraries/LibJS/Runtime/ObjectConstructor.cpp @@ -67,7 +67,7 @@ Value ObjectConstructor::get_own_property_names(Interpreter& interpreter) auto* object = interpreter.argument(0).to_object(interpreter.heap()); if (interpreter.exception()) return {}; - auto* result = interpreter.heap().allocate<Array>(); + auto* result = Array::create(interpreter.global_object()); for (size_t i = 0; i < object->elements().size(); ++i) { if (!object->elements()[i].is_empty()) result->elements().append(js_string(interpreter, String::number(i))); |