mirror of
https://github.com/bellard/quickjs.git
synced 2025-11-15 18:22:15 +03:00
fixed Date parsing: "1997-03-08 11:19:10-0700" is a valid date and "1997-03-08T11:19:10-07" should yield an error
This commit is contained in:
2
TODO
2
TODO
@@ -62,5 +62,5 @@ Optimization ideas:
|
|||||||
Test262o: 0/11262 errors, 463 excluded
|
Test262o: 0/11262 errors, 463 excluded
|
||||||
Test262o commit: 7da91bceb9ce7613f87db47ddd1292a2dda58b42 (es5-tests branch)
|
Test262o commit: 7da91bceb9ce7613f87db47ddd1292a2dda58b42 (es5-tests branch)
|
||||||
|
|
||||||
Result: 48/81934 errors, 1631 excluded, 5476 skipped
|
Result: 47/81934 errors, 1631 excluded, 5476 skipped
|
||||||
Test262 commit: e7e136756cd67c1ffcf7c09d03aeb8ad5a6cec0c
|
Test262 commit: e7e136756cd67c1ffcf7c09d03aeb8ad5a6cec0c
|
||||||
|
|||||||
15
quickjs.c
15
quickjs.c
@@ -53427,9 +53427,14 @@ static BOOL string_get_tzoffset(const uint8_t *sp, int *pp, int *tzp, BOOL stric
|
|||||||
hh = hh / 100;
|
hh = hh / 100;
|
||||||
} else {
|
} else {
|
||||||
mm = 0;
|
mm = 0;
|
||||||
if (string_skip_char(sp, &p, ':') /* optional separator */
|
if (string_skip_char(sp, &p, ':')) {
|
||||||
&& !string_get_digits(sp, &p, &mm, 2, 2))
|
/* optional separator */
|
||||||
return FALSE;
|
if (!string_get_digits(sp, &p, &mm, 2, 2))
|
||||||
|
return FALSE;
|
||||||
|
} else {
|
||||||
|
if (strict)
|
||||||
|
return FALSE; /* [+-]HH is not accepted in strict mode */
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (hh > 23 || mm > 59)
|
if (hh > 23 || mm > 59)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -53628,6 +53633,10 @@ static BOOL js_date_parse_otherstring(const uint8_t *sp,
|
|||||||
string_get_milliseconds(sp, &p, &fields[6]);
|
string_get_milliseconds(sp, &p, &fields[6]);
|
||||||
}
|
}
|
||||||
has_time = TRUE;
|
has_time = TRUE;
|
||||||
|
if ((sp[p] == '+' || sp[p] == '-') &&
|
||||||
|
string_get_tzoffset(sp, &p, &fields[8], FALSE)) {
|
||||||
|
*is_local = FALSE;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (p - p_start > 2) {
|
if (p - p_start > 2) {
|
||||||
fields[0] = val;
|
fields[0] = val;
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ test262/test/annexB/language/expressions/assignmenttargettype/callexpression.js:
|
|||||||
test262/test/annexB/language/expressions/assignmenttargettype/cover-callexpression-and-asyncarrowhead.js:20: SyntaxError: invalid assignment left-hand side
|
test262/test/annexB/language/expressions/assignmenttargettype/cover-callexpression-and-asyncarrowhead.js:20: SyntaxError: invalid assignment left-hand side
|
||||||
test262/test/staging/sm/Date/UTC-convert-all-arguments.js:75: Test262Error: index 1: expected 42, got Error: didn't throw Expected SameValue(«Error: didn't throw», «42») to be true
|
test262/test/staging/sm/Date/UTC-convert-all-arguments.js:75: Test262Error: index 1: expected 42, got Error: didn't throw Expected SameValue(«Error: didn't throw», «42») to be true
|
||||||
test262/test/staging/sm/Date/constructor-convert-all-arguments.js:75: Test262Error: index undefined: expected 42, got Error: didn't throw Expected SameValue(«Error: didn't throw», «42») to be true
|
test262/test/staging/sm/Date/constructor-convert-all-arguments.js:75: Test262Error: index undefined: expected 42, got Error: didn't throw Expected SameValue(«Error: didn't throw», «42») to be true
|
||||||
test262/test/staging/sm/Date/non-iso.js:76: Test262Error: Expected SameValue(«NaN», «-40071559730000») to be true
|
|
||||||
test262/test/staging/sm/Date/two-digit-years.js:76: Test262Error: Expected SameValue(«915177600000», «NaN») to be true
|
test262/test/staging/sm/Date/two-digit-years.js:76: Test262Error: Expected SameValue(«915177600000», «NaN») to be true
|
||||||
test262/test/staging/sm/Function/arguments-parameter-shadowing.js:15: Test262Error: Expected SameValue(«true», «false») to be true
|
test262/test/staging/sm/Function/arguments-parameter-shadowing.js:15: Test262Error: Expected SameValue(«true», «false») to be true
|
||||||
test262/test/staging/sm/Function/constructor-binding.js:12: Test262Error: Expected SameValue(«"function"», «"undefined"») to be true
|
test262/test/staging/sm/Function/constructor-binding.js:12: Test262Error: Expected SameValue(«"function"», «"undefined"») to be true
|
||||||
|
|||||||
Reference in New Issue
Block a user