diff options
author | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-06-15 09:57:36 (GMT) |
---|---|---|
committer | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-06-15 09:57:36 (GMT) |
commit | 336dfcef05cb63df0a6d550b59a4badc7a0f01c1 (patch) | |
tree | a218ec97413e0c8ebc9600ac5db9b2adea485b32 /src/3rdparty/webkit/JavaScriptCore/runtime/JSValue.cpp | |
parent | e44d64510e019e5d3b379b704cfb824e0d7ccc9d (diff) | |
download | Qt-336dfcef05cb63df0a6d550b59a4badc7a0f01c1.zip Qt-336dfcef05cb63df0a6d550b59a4badc7a0f01c1.tar.gz Qt-336dfcef05cb63df0a6d550b59a4badc7a0f01c1.tar.bz2 |
Merge of master
Diffstat (limited to 'src/3rdparty/webkit/JavaScriptCore/runtime/JSValue.cpp')
-rw-r--r-- | src/3rdparty/webkit/JavaScriptCore/runtime/JSValue.cpp | 25 |
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 |