Changeset 36434 in webkit for trunk/JavaScriptCore
- Timestamp:
- Sep 15, 2008, 2:39:26 AM (17 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r36429 r36434 1 2008-09-15 Cameron Zwarich <[email protected]> 2 3 Reviewed by Maciej Stachowiak. 4 5 Bug 20851: REGRESSION (r36410): fast/js/kde/GlobalObject.html fails 6 <https://bugs.webkit.org/show_bug.cgi?id=20851> 7 8 r36410 introduced an optimization for parseInt() that is incorrect when 9 its argument is larger than the range of a 32-bit integer. If the 10 argument is a number that is not an immediate integer, then the correct 11 behaviour is to return the floor of its value, unless it is an infinite 12 value, in which case the correct behaviour is to return 0. 13 14 * kjs/JSGlobalObjectFunctions.cpp: 15 (JSC::globalFuncParseInt): 16 1 17 2008-09-15 Sam Weinig <[email protected]> 2 18 -
trunk/JavaScriptCore/kjs/JSGlobalObjectFunctions.cpp
r36410 r36434 298 298 int32_t radix = args.at(exec, 1)->toInt32(exec); 299 299 300 if (value->isNumber() && (radix == 0 || radix == 10)) 301 return jsNumber(exec, value->toInt32(exec)); 300 if (value->isNumber() && (radix == 0 || radix == 10)) { 301 if (JSImmediate::isImmediate(value)) 302 return value; 303 double d = value->uncheckedGetNumber(); 304 if (!isfinite(d)) 305 return JSImmediate::zeroImmediate(); 306 return jsNumber(exec, floor(d)); 307 } 302 308 303 309 return jsNumber(exec, parseInt(value->toString(exec), radix));
Note:
See TracChangeset
for help on using the changeset viewer.