Changeset 202683 in webkit
- Timestamp:
- Jun 30, 2016 10:16:39 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r202682 r202683 1 2016-06-30 Benjamin Poulain <bpoulain@apple.com> 2 3 [JSC] Date.setYear() misses timeClip() 4 https://bugs.webkit.org/show_bug.cgi?id=159289 5 6 Reviewed by Geoffrey Garen. 7 8 * js/date-timeClip-large-values-expected.txt: 9 * js/script-tests/date-timeClip-large-values.js: 10 The failures are caused by bugs related to GregorianDateTime. 11 The last test case is the one covering this patch. 12 1 13 2016-06-30 Commit Queue <commit-queue@webkit.org> 2 14 -
trunk/LayoutTests/js/date-timeClip-large-values-expected.txt
r201586 r202683 51 51 PASS new Date(8.64e15).setMonth(new Date(8.64e15).getMonth()).valueOf() is 8.64e15 52 52 PASS new Date(8.64e15).setMonth(new Date(8.64e15).getMonth() + 1).valueOf() is NaN 53 Testing setYear() 54 PASS new Date(0).setYear(Infinity).valueOf() is NaN 55 FAIL new Date(0).setYear(1.79769e+308).valueOf() should be NaN. Was -62135596800000. 56 FAIL new Date(0).setYear(-1.79769e+308).valueOf() should be NaN. Was -62135596800000. 57 PASS new Date(8.64e15).setYear(new Date(8.64e15).getFullYear()).valueOf() is 8.64e15 58 PASS new Date(8.64e15).setYear(new Date(8.64e15).getFullYear() + 1).valueOf() is NaN 53 59 Testing setFullYear() 54 60 PASS new Date(0).setFullYear(Infinity).valueOf() is NaN -
trunk/LayoutTests/js/script-tests/date-timeClip-large-values.js
r201586 r202683 54 54 shouldBe("new Date(8.64e15).setMonth(new Date(8.64e15).getMonth()).valueOf()", "8.64e15"); 55 55 shouldBe("new Date(8.64e15).setMonth(new Date(8.64e15).getMonth() + 1).valueOf()", "NaN"); 56 57 debug("Testing setYear()"); 58 shouldBe("new Date(0).setYear(Infinity).valueOf()", "NaN"); 59 shouldBe("new Date(0).setYear(1.79769e+308).valueOf()", "NaN"); 60 shouldBe("new Date(0).setYear(-1.79769e+308).valueOf()", "NaN"); 61 shouldBe("new Date(8.64e15).setYear(new Date(8.64e15).getFullYear()).valueOf()", "8.64e15"); 62 shouldBe("new Date(8.64e15).setYear(new Date(8.64e15).getFullYear() + 1).valueOf()", "NaN"); 56 63 57 64 debug("Testing setFullYear()"); -
trunk/Source/JavaScriptCore/ChangeLog
r202680 r202683 1 2016-06-30 Benjamin Poulain <bpoulain@apple.com> 2 3 [JSC] Date.setYear() misses timeClip() 4 https://bugs.webkit.org/show_bug.cgi?id=159289 5 6 Reviewed by Geoffrey Garen. 7 8 * runtime/DatePrototype.cpp: 9 (JSC::dateProtoFuncSetYear): 10 1 11 2016-06-30 Joseph Pecoraro <pecoraro@apple.com> and Yusuke Suzuki <utatane.tea@gmail.com> 2 12 -
trunk/Source/JavaScriptCore/runtime/DatePrototype.cpp
r201586 r202683 1075 1075 1076 1076 gregorianDateTime.setYear(toInt32((year >= 0 && year <= 99) ? (year + 1900) : year)); 1077 JSValue result = jsNumber(gregorianDateTimeToMS(vm, gregorianDateTime, ms, WTF::LocalTime)); 1077 double timeInMilliseconds = gregorianDateTimeToMS(vm, gregorianDateTime, ms, WTF::LocalTime); 1078 JSValue result = jsNumber(timeClip(timeInMilliseconds)); 1078 1079 thisDateObj->setInternalValue(vm, result); 1079 1080 return JSValue::encode(result);
Note: See TracChangeset
for help on using the changeset viewer.