summaryrefslogtreecommitdiff
path: root/src/3rdparty/webkit/JavaScriptCore/runtime/Operations.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/webkit/JavaScriptCore/runtime/Operations.cpp')
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/runtime/Operations.cpp26
1 files changed, 8 insertions, 18 deletions
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/Operations.cpp b/src/3rdparty/webkit/JavaScriptCore/runtime/Operations.cpp
index 093bbecf38..cf236bf5e3 100644
--- a/src/3rdparty/webkit/JavaScriptCore/runtime/Operations.cpp
+++ b/src/3rdparty/webkit/JavaScriptCore/runtime/Operations.cpp
@@ -29,10 +29,6 @@
#include <stdio.h>
#include <wtf/MathExtras.h>
-#if HAVE(FLOAT_H)
-#include <float.h>
-#endif
-
namespace JSC {
bool JSValue::equalSlowCase(ExecState* exec, JSValue v1, JSValue v2)
@@ -40,16 +36,9 @@ bool JSValue::equalSlowCase(ExecState* exec, JSValue v1, JSValue v2)
return equalSlowCaseInline(exec, v1, v2);
}
-bool JSValue::strictEqualSlowCase(JSValue v1, JSValue v2)
-{
- return strictEqualSlowCaseInline(v1, v2);
-}
-
-NEVER_INLINE JSValue throwOutOfMemoryError(ExecState* exec)
+bool JSValue::strictEqualSlowCase(ExecState* exec, JSValue v1, JSValue v2)
{
- JSObject* error = Error::create(exec, GeneralError, "Out of memory");
- exec->setException(error);
- return error;
+ return strictEqualSlowCaseInline(exec, v1, v2);
}
NEVER_INLINE JSValue jsAddSlowCase(CallFrame* callFrame, JSValue v1, JSValue v2)
@@ -58,12 +47,13 @@ NEVER_INLINE JSValue jsAddSlowCase(CallFrame* callFrame, JSValue v1, JSValue v2)
JSValue p1 = v1.toPrimitive(callFrame);
JSValue p2 = v2.toPrimitive(callFrame);
- if (p1.isString() || p2.isString()) {
- RefPtr<UString::Rep> value = concatenate(p1.toString(callFrame).rep(), p2.toString(callFrame).rep());
- if (!value)
- return throwOutOfMemoryError(callFrame);
- return jsString(callFrame, value.release());
+ if (p1.isString()) {
+ return p2.isString()
+ ? jsString(callFrame, asString(p1), asString(p2))
+ : jsString(callFrame, asString(p1), p2.toString(callFrame));
}
+ if (p2.isString())
+ return jsString(callFrame, p1.toString(callFrame), asString(p2));
return jsNumber(callFrame, p1.toNumber(callFrame) + p2.toNumber(callFrame));
}