Skip to content

Commit 2161640

Browse files
author
Fabrice Bellard
committed
stricter year parsing in Date
1 parent 7fb994c commit 2161640

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

‎TODO‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,4 @@ Test262o: 0/11262 errors, 463 excluded
6363
Test262o commit: 7da91bceb9ce7613f87db47ddd1292a2dda58b42 (es5-tests branch)
6464

6565
Test262:
66-
Result: 63/83149 errors, 1645 excluded, 5538 skipped
66+
Result: 61/83149 errors, 1645 excluded, 5538 skipped

‎quickjs.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53839,11 +53839,11 @@ static BOOL js_date_parse_otherstring(const uint8_t *sp,
5383953839
*is_local = FALSE;
5384053840
}
5384153841
} else {
53842-
if (p - p_start > 2) {
53842+
if (p - p_start > 2 && !has_year) {
5384353843
fields[0] = val;
5384453844
has_year = TRUE;
5384553845
} else
53846-
if (val < 1 || val > 31) {
53846+
if ((val < 1 || val > 31) && !has_year) {
5384753847
fields[0] = val + (val < 100) * 1900 + (val < 50) * 100;
5384853848
has_year = TRUE;
5384953849
} else {

‎test262_errors.txt‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ test262/test/annexB/language/expressions/assignmenttargettype/callexpression.js:
77
test262/test/annexB/language/expressions/assignmenttargettype/cover-callexpression-and-asyncarrowhead.js:20: SyntaxError: invalid assignment left-hand side
88
test262/test/language/identifier-resolution/assign-to-global-undefined.js:20: strict mode: expected error
99
test262/test/language/module-code/top-level-await/rejection-order.js:20: TypeError: $DONE() not called
10-
test262/test/staging/sm/Date/two-digit-years.js:26: Test262Error: Expected SameValue(«915177600000», «NaN») to be true
11-
test262/test/staging/sm/Date/two-digit-years.js:26: strict mode: Test262Error: Expected SameValue(«915177600000», «NaN») to be true
1210
test262/test/staging/sm/Function/arguments-parameter-shadowing.js:14: Test262Error: Expected SameValue(«true», «false») to be true
1311
test262/test/staging/sm/Function/constructor-binding.js:11: Test262Error: Expected SameValue(«"function"», «"undefined"») to be true
1412
test262/test/staging/sm/Function/constructor-binding.js:11: strict mode: Test262Error: Expected SameValue(«"function"», «"undefined"») to be true

0 commit comments

Comments
 (0)