Changeset 288411 in webkit
- Timestamp:
- Jan 22, 2022 4:00:38 PM (6 months ago)
- Location:
- trunk
- Files:
-
- 1 added
- 6 edited
-
JSTests/ChangeLog (modified) (1 diff)
-
JSTests/stress/date-relaxed-separator.js (added)
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/js/date-parse-test-expected.txt (modified) (1 diff)
-
LayoutTests/js/script-tests/date-parse-test.js (modified) (1 diff)
-
Source/WTF/ChangeLog (modified) (1 diff)
-
Source/WTF/wtf/DateMath.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r288272 r288411 1 2022-01-21 Yusuke Suzuki <ysuzuki@apple.com> 2 3 [JSC] Relax Date.parse requirement 4 https://bugs.webkit.org/show_bug.cgi?id=235468 5 6 Reviewed by Darin Adler. 7 8 * stress/date-relaxed-separator.js: Added. 9 (shouldBe): 10 1 11 2022-01-19 Yusuke Suzuki <ysuzuki@apple.com> 2 12 -
trunk/LayoutTests/ChangeLog
r288409 r288411 1 2022-01-21 Yusuke Suzuki <ysuzuki@apple.com> 2 3 [JSC] Relax Date.parse requirement 4 https://bugs.webkit.org/show_bug.cgi?id=235468 5 6 Reviewed by Darin Adler. 7 8 * js/date-parse-test-expected.txt: 9 * js/script-tests/date-parse-test.js: 10 1 11 2022-01-22 Alan Bujtas <zalan@apple.com> 2 12 -
trunk/LayoutTests/js/date-parse-test-expected.txt
r254939 r288411 28 28 PASS Date.parse("1995-12-25T01:30:00+00:00 ") is NaN 29 29 PASS Date.parse("1995-02-29T00:00:00Z") is NaN 30 PASS Date.parse("1995-12-25 01:30:00Z") is NaN30 PASS Date.parse("1995-12-25 01:30:00Z") == 819855000000 is true 31 31 PASS Date.parse("1995-12-25T01:30:00z") is NaN 32 32 PASS Number(Date.parse('1970')) is 0 -
trunk/LayoutTests/js/script-tests/date-parse-test.js
r254939 r288411 67 67 testDateParseExact("1995-12-25T01:30:00+00:00 ", "NaN"); 68 68 testDateParseExact("1995-02-29T00:00:00Z", "NaN"); 69 testDateParseExact("1995-12-25 01:30:00Z", " NaN");69 testDateParseExact("1995-12-25 01:30:00Z", "819855000000"); 70 70 testDateParseExact("1995-12-25T01:30:00z", "NaN"); 71 71 -
trunk/Source/WTF/ChangeLog
r288389 r288411 1 2022-01-21 Yusuke Suzuki <ysuzuki@apple.com> 2 3 [JSC] Relax Date.parse requirement 4 https://bugs.webkit.org/show_bug.cgi?id=235468 5 6 Reviewed by Darin Adler. 7 8 While the spec does not require accepting 't' / ' ' separator, ISO 8601 accepts it. 9 This is because ECMA262's Date format is *not* ISO 8601 (it is called simplification 10 of ISO 8601[1]). 11 This patch relaxes this strictness to accept more formats, which can be accepted in 12 the other engines too. 13 14 [1]: https://tc39.es/ecma262/#sec-date-time-string-format 15 16 * wtf/DateMath.cpp: 17 (WTF::parseES5DateFromNullTerminatedCharacters): 18 1 19 2022-01-21 Sihui Liu <sihui_liu@apple.com> 2 20 -
trunk/Source/WTF/wtf/DateMath.cpp
r278253 r288411 646 646 // Look for a time portion. 647 647 // Note: As of ES2016, when a UTC offset is missing, date-time forms are local time while date-only forms are UTC. 648 if (*currentPosition == 'T' ) {648 if (*currentPosition == 'T' || *currentPosition == 't' || *currentPosition == ' ') { 649 649 // Parse the time HH:mm[:ss[.sss]][Z|(+|-)(00:00|0000|00)] 650 650 currentPosition = parseES5TimePortion(currentPosition + 1, hours, minutes, seconds, milliseconds, isLocalTime, timeZoneSeconds);
Note: See TracChangeset
for help on using the changeset viewer.