浏览代码

LibJS: Set correct "length" of Object constructor

Linus Groh 5 年之前
父节点
当前提交
d007e8d00f
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      Libraries/LibJS/Runtime/ObjectConstructor.cpp

+ 1 - 0
Libraries/LibJS/Runtime/ObjectConstructor.cpp

@@ -39,6 +39,7 @@ ObjectConstructor::ObjectConstructor()
     : NativeFunction("Object", *interpreter().global_object().function_prototype())
 {
     put("prototype", interpreter().global_object().object_prototype(), 0);
+    put("length", Value(1), Attribute::Configurable);
 
     u8 attr = Attribute::Writable | Attribute::Configurable;
     put_native_function("defineProperty", define_property, 3, attr);