diff options
Diffstat (limited to 'JavaScriptCore/runtime/ArrayConstructor.cpp')
| -rw-r--r-- | JavaScriptCore/runtime/ArrayConstructor.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/JavaScriptCore/runtime/ArrayConstructor.cpp b/JavaScriptCore/runtime/ArrayConstructor.cpp index dd3ff4b..e96bdfc 100644 --- a/JavaScriptCore/runtime/ArrayConstructor.cpp +++ b/JavaScriptCore/runtime/ArrayConstructor.cpp @@ -26,6 +26,7 @@ #include "ArrayPrototype.h" #include "JSArray.h" +#include "JSFunction.h" #include "Lookup.h" namespace JSC { @@ -45,15 +46,15 @@ ArrayConstructor::ArrayConstructor(ExecState* exec, PassRefPtr<Structure> struct static JSObject* constructArrayWithSizeQuirk(ExecState* exec, const ArgList& args) { // a single numeric argument denotes the array size (!) - if (args.size() == 1 && args.at(exec, 0).isNumber()) { - uint32_t n = args.at(exec, 0).toUInt32(exec); - if (n != args.at(exec, 0).toNumber(exec)) + if (args.size() == 1 && args.at(0).isNumber()) { + uint32_t n = args.at(0).toUInt32(exec); + if (n != args.at(0).toNumber(exec)) return throwError(exec, RangeError, "Array size is not a small enough positive integer."); return new (exec) JSArray(exec->lexicalGlobalObject()->arrayStructure(), n); } // otherwise the array is constructed with the arguments in it - return new (exec) JSArray(exec, exec->lexicalGlobalObject()->arrayStructure(), args); + return new (exec) JSArray(exec->lexicalGlobalObject()->arrayStructure(), args); } static JSObject* constructWithArrayConstructor(ExecState* exec, JSObject*, const ArgList& args) @@ -68,7 +69,7 @@ ConstructType ArrayConstructor::getConstructData(ConstructData& constructData) return ConstructTypeHost; } -static JSValuePtr callArrayConstructor(ExecState* exec, JSObject*, JSValuePtr, const ArgList& args) +static JSValue JSC_HOST_CALL callArrayConstructor(ExecState* exec, JSObject*, JSValue, const ArgList& args) { return constructArrayWithSizeQuirk(exec, args); } |
