summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/webkit/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp')
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp b/src/3rdparty/webkit/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
index f12d2f3a81..ecdddcf339 100644
--- a/src/3rdparty/webkit/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
+++ b/src/3rdparty/webkit/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
@@ -302,9 +302,11 @@ JSValuePtr globalFuncParseInt(ExecState* exec, JSObject*, JSValuePtr, const ArgL
if (JSImmediate::isImmediate(value))
return value;
double d = value->uncheckedGetNumber();
- if (!isfinite(d))
- return JSImmediate::zeroImmediate();
- return jsNumber(exec, floor(d));
+ if (isfinite(d))
+ return jsNumber(exec, floor(d));
+ if (isnan(d) || isinf(d))
+ return jsNaN(&exec->globalData());
+ return JSImmediate::zeroImmediate();
}
return jsNumber(exec, parseInt(value->toString(exec), radix));