Changeset 291603 in webkit
- Timestamp:
- Mar 21, 2022 9:26:31 PM (4 months ago)
- Location:
- trunk
- Files:
-
- 1 added
- 3 edited
-
JSTests/ChangeLog (modified) (1 diff)
-
JSTests/stress/date-parse-timeclip.js (added)
-
Source/JavaScriptCore/ChangeLog (modified) (1 diff)
-
Source/JavaScriptCore/runtime/DateConstructor.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r291577 r291603 1 2022-03-21 Yusuke Suzuki <ysuzuki@apple.com> 2 3 [JSC] Change Date.parse to stop returning numbers with fractional part 4 https://bugs.webkit.org/show_bug.cgi?id=238050 5 6 Reviewed by Saam Barati. 7 8 * stress/date-parse-timeclip.js: Added. 9 (shouldBe): 10 1 11 2022-03-21 Yusuke Suzuki <ysuzuki@apple.com> 2 12 -
trunk/Source/JavaScriptCore/ChangeLog
r291602 r291603 1 2022-03-21 Yusuke Suzuki <ysuzuki@apple.com> 2 3 [JSC] Change Date.parse to stop returning numbers with fractional part 4 https://bugs.webkit.org/show_bug.cgi?id=238050 5 6 Reviewed by Saam Barati. 7 8 Date.parse should return NaN or integer numbers[1,2]. This patch applies timeClip 9 to the result of Date.parse to ensure that the returned value is time value. 10 11 [1]: https://tc39.es/ecma262/multipage/numbers-and-dates.html#sec-date.parse 12 [2]: https://tc39.es/ecma262/multipage/numbers-and-dates.html#sec-time-values-and-time-range 13 14 * runtime/DateConstructor.cpp: 15 (JSC::JSC_DEFINE_HOST_FUNCTION): 16 1 17 2022-03-21 Saam Barati <sbarati@apple.com> 2 18 -
trunk/Source/JavaScriptCore/runtime/DateConstructor.cpp
r273661 r291603 160 160 String dateStr = callFrame->argument(0).toWTFString(globalObject); 161 161 RETURN_IF_EXCEPTION(scope, encodedJSValue()); 162 RELEASE_AND_RETURN(scope, JSValue::encode(jsNumber( vm.dateCache.parseDate(globalObject, vm, dateStr))));162 RELEASE_AND_RETURN(scope, JSValue::encode(jsNumber(timeClip(vm.dateCache.parseDate(globalObject, vm, dateStr))))); 163 163 } 164 164
Note: See TracChangeset
for help on using the changeset viewer.