summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/JavaScriptCore/runtime/JSValue.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/webkit/JavaScriptCore/runtime/JSValue.cpp')
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/runtime/JSValue.cpp25
1 files changed, 4 insertions, 21 deletions
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/JSValue.cpp b/src/3rdparty/webkit/JavaScriptCore/runtime/JSValue.cpp
index 73580b0..885914d 100644
--- a/src/3rdparty/webkit/JavaScriptCore/runtime/JSValue.cpp
+++ b/src/3rdparty/webkit/JavaScriptCore/runtime/JSValue.cpp
@@ -33,18 +33,16 @@ static const double D32 = 4294967296.0;
// ECMA 9.4
double JSValue::toInteger(ExecState* exec) const
{
- int32_t i;
- if (getTruncatedInt32(i))
- return i;
+ if (isInt32Fast())
+ return getInt32Fast();
double d = toNumber(exec);
return isnan(d) ? 0.0 : trunc(d);
}
double JSValue::toIntegerPreserveNaN(ExecState* exec) const
{
- int32_t i;
- if (getTruncatedInt32(i))
- return i;
+ if (isInt32Fast())
+ return getInt32Fast();
return trunc(toNumber(exec));
}
@@ -68,11 +66,6 @@ int32_t toInt32SlowCase(double d, bool& ok)
return static_cast<int32_t>(d32);
}
-int32_t JSValue::toInt32SlowCase(ExecState* exec, bool& ok) const
-{
- return JSC::toInt32SlowCase(toNumber(exec), ok);
-}
-
uint32_t toUInt32SlowCase(double d, bool& ok)
{
ok = true;
@@ -91,14 +84,4 @@ uint32_t toUInt32SlowCase(double d, bool& ok)
return static_cast<uint32_t>(d32);
}
-uint32_t JSValue::toUInt32SlowCase(ExecState* exec, bool& ok) const
-{
- return JSC::toUInt32SlowCase(toNumber(exec), ok);
-}
-
-float JSValue::toFloat(ExecState* exec) const
-{
- return static_cast<float>(toNumber(exec));
-}
-
} // namespace JSC