diff options
-rw-r--r-- | src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog | 10 | ||||
-rw-r--r-- | src/3rdparty/javascriptcore/JavaScriptCore/runtime/MathObject.cpp | 3 | ||||
-rw-r--r-- | src/3rdparty/javascriptcore/VERSION | 2 |
3 files changed, 13 insertions, 2 deletions
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog b/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog index 91b0ea6..9214fa2 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog +++ b/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog @@ -1,3 +1,13 @@ +2010-02-01 Kent Tamura <tkent@chromium.org> + + Reviewed by Darin Adler. + + Fix a bug that Math.round() retunrs incorrect results for huge integers + https://bugs.webkit.org/show_bug.cgi?id=34462 + + * runtime/MathObject.cpp: + (JSC::mathProtoFuncRound): Avoid "arg + 0.5". + 2010-02-01 Patrick Gansterer <paroga@paroga.com> Reviewed by Darin Adler. diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/MathObject.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/MathObject.cpp index 98ff3ba..8f22fba 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/MathObject.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/MathObject.cpp @@ -218,7 +218,8 @@ JSValue JSC_HOST_CALL mathProtoFuncRound(ExecState* exec, JSObject*, JSValue, co double arg = args.at(0).toNumber(exec); if (signbit(arg) && arg >= -0.5) return jsNumber(exec, -0.0); - return jsNumber(exec, floor(arg + 0.5)); + double integer = ceil(arg); + return jsNumber(exec, integer - (integer - arg > 0.5)); } JSValue JSC_HOST_CALL mathProtoFuncSin(ExecState* exec, JSObject*, JSValue, const ArgList& args) diff --git a/src/3rdparty/javascriptcore/VERSION b/src/3rdparty/javascriptcore/VERSION index c67d5c2..25e4ee2 100644 --- a/src/3rdparty/javascriptcore/VERSION +++ b/src/3rdparty/javascriptcore/VERSION @@ -8,4 +8,4 @@ The commit imported was from the and has the sha1 checksum - b9992e6339bc2bc30933303d3b888fb7eb4ae778 + b620465e6f809ddb0f8ed0fb732e9f8498d94755 |