- // ES5
- putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 1, exec->propertyNames().isArray, arrayConstructorIsArray), DontEnum);
+bool ArrayConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, PropertyName propertyName, PropertyDescriptor& descriptor)
+{
+ return getStaticFunctionDescriptor<InternalFunction>(exec, ExecState::arrayConstructorTable(exec), jsCast<ArrayConstructor*>(object), propertyName, descriptor);
+}
+
+// ------------------------------ Functions ---------------------------
+
+JSObject* constructArrayWithSizeQuirk(ExecState* exec, ArrayAllocationProfile* profile, JSGlobalObject* globalObject, JSValue length)
+{
+ if (!length.isNumber())
+ return constructArray(exec, profile, globalObject, &length, 1);
+
+ uint32_t n = length.toUInt32(exec);
+ if (n != length.toNumber(exec))
+ return throwError(exec, createRangeError(exec, ASCIILiteral("Array size is not a small enough positive integer.")));
+ return constructEmptyArray(exec, profile, globalObject, n);