summaryrefslogtreecommitdiffstats
path: root/JavaScriptCore/runtime/ArrayConstructor.cpp
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2010-06-15 19:36:43 +0100
committerBen Murdoch <benm@google.com>2010-06-16 14:52:28 +0100
commit545e470e52f0ac6a3a072bf559c796b42c6066b6 (patch)
treec0c14763654d84d37577dde512c3d3b4699a9e86 /JavaScriptCore/runtime/ArrayConstructor.cpp
parent719298a66237d38ea5c05f1547123ad8aacbc237 (diff)
downloadexternal_webkit-545e470e52f0ac6a3a072bf559c796b42c6066b6.zip
external_webkit-545e470e52f0ac6a3a072bf559c796b42c6066b6.tar.gz
external_webkit-545e470e52f0ac6a3a072bf559c796b42c6066b6.tar.bz2
Merge webkit.org at r61121: Initial merge by git.
Change-Id: Icd6db395c62285be384d137164d95d7466c98760
Diffstat (limited to 'JavaScriptCore/runtime/ArrayConstructor.cpp')
-rw-r--r--JavaScriptCore/runtime/ArrayConstructor.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/JavaScriptCore/runtime/ArrayConstructor.cpp b/JavaScriptCore/runtime/ArrayConstructor.cpp
index 674d00a..589739a 100644
--- a/JavaScriptCore/runtime/ArrayConstructor.cpp
+++ b/JavaScriptCore/runtime/ArrayConstructor.cpp
@@ -26,6 +26,7 @@
#include "ArrayPrototype.h"
#include "Error.h"
+#include "ExceptionHelpers.h"
#include "JSArray.h"
#include "JSFunction.h"
#include "Lookup.h"
@@ -35,7 +36,7 @@ namespace JSC {
ASSERT_CLASS_FITS_IN_CELL(ArrayConstructor);
-static JSValue JSC_HOST_CALL arrayConstructorIsArray(ExecState*);
+static EncodedJSValue JSC_HOST_CALL arrayConstructorIsArray(ExecState*);
ArrayConstructor::ArrayConstructor(ExecState* exec, JSGlobalObject* globalObject, NonNullPassRefPtr<Structure> structure, ArrayPrototype* arrayPrototype, Structure* prototypeFunctionStructure)
: InternalFunction(&exec->globalData(), globalObject, structure, Identifier(exec, arrayPrototype->classInfo()->className))
@@ -56,7 +57,7 @@ static inline JSObject* constructArrayWithSizeQuirk(ExecState* exec, const ArgLi
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 throwError(exec, createRangeError(exec, "Array size is not a small enough positive integer."));
return new (exec) JSArray(exec->lexicalGlobalObject()->arrayStructure(), n);
}
@@ -64,9 +65,10 @@ static inline JSObject* constructArrayWithSizeQuirk(ExecState* exec, const ArgLi
return new (exec) JSArray(exec->lexicalGlobalObject()->arrayStructure(), args);
}
-static JSObject* constructWithArrayConstructor(ExecState* exec, JSObject*, const ArgList& args)
+static EncodedJSValue JSC_HOST_CALL constructWithArrayConstructor(ExecState* exec)
{
- return constructArrayWithSizeQuirk(exec, args);
+ ArgList args(exec);
+ return JSValue::encode(constructArrayWithSizeQuirk(exec, args));
}
// ECMA 15.4.2
@@ -76,10 +78,10 @@ ConstructType ArrayConstructor::getConstructData(ConstructData& constructData)
return ConstructTypeHost;
}
-static JSValue JSC_HOST_CALL callArrayConstructor(ExecState* exec)
+static EncodedJSValue JSC_HOST_CALL callArrayConstructor(ExecState* exec)
{
ArgList args(exec);
- return constructArrayWithSizeQuirk(exec, args);
+ return JSValue::encode(constructArrayWithSizeQuirk(exec, args));
}
// ECMA 15.6.1
@@ -90,9 +92,9 @@ CallType ArrayConstructor::getCallData(CallData& callData)
return CallTypeHost;
}
-JSValue JSC_HOST_CALL arrayConstructorIsArray(ExecState* exec)
+EncodedJSValue JSC_HOST_CALL arrayConstructorIsArray(ExecState* exec)
{
- return jsBoolean(exec->argument(0).inherits(&JSArray::info));
+ return JSValue::encode(jsBoolean(exec->argument(0).inherits(&JSArray::info)));
}
} // namespace JSC