Skip to content
Permalink
Browse files
[JSC] Temporal tweaks to pass more test262 tests
https://bugs.webkit.org/show_bug.cgi?id=231331

Patch by Philip Chimento <pchimento@igalia.com> on 2021-10-07
Reviewed by Yusuke Suzuki.

JSTests:

* test262/config.yaml: Three tests no longer crash, but they still
  depend on unimplemented functionality, so skip them.
* test262/expectations.yaml:

Source/JavaScriptCore:

* runtime/ISO8601.h:
(JSC::ISO8601::Duration::operator[]): Add an overload for Duration[]
  that indexes by TemporalUnit enum instead of integer index.
(JSC::ISO8601::Duration::operator[] const):
* runtime/TemporalDuration.cpp:
(JSC::TemporalDuration::fromDurationLike): Access Duration properties in
  the order defined in the specification.
(JSC::TemporalDuration::with const): Access Duration properties in the
  order defined in the specification.
(JSC::TemporalDuration::round const): Temporarily throw an exception
  here instead of failing an assertion, when attempting to use
  unimplemented relativeTo functionality.
* runtime/TemporalObject.cpp:
(JSC::temporalUnitPluralPropertyName): Rename from
  temporalUnitPropertyName.
(JSC::temporalUnitSingularPropertyName): Added.
* runtime/TemporalObject.h: Add array corresponding to the table in the
  spec text specifying alphabetical access order for unit properties.
* runtime/TemporalPlainTime.cpp:
(JSC::toTemporalTimeRecord): Access PlainTime properties in the order
  defined in the specification.
(JSC::toPartialTime): Access PlainTime properties in the order defined
  in the specification.

Canonical link: https://commits.webkit.org/242631@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@283705 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
ptomato authored and webkit-commit-queue committed Oct 7, 2021
1 parent 8398ffb commit 79ff5b510aab1e5c1da404c1bdd27dbe528cd88b
Showing 9 changed files with 110 additions and 63 deletions.
@@ -1,3 +1,14 @@
2021-10-07 Philip Chimento <pchimento@igalia.com>

[JSC] Temporal tweaks to pass more test262 tests
https://bugs.webkit.org/show_bug.cgi?id=231331

Reviewed by Yusuke Suzuki.

* test262/config.yaml: Three tests no longer crash, but they still
depend on unimplemented functionality, so skip them.
* test262/expectations.yaml:

2021-10-06 Ross Kirsling <ross.kirsling@sony.com>

Unreviewed, ensure test262 expectations reflect BigSur release mode.
@@ -203,13 +203,16 @@ skip:
- test/built-ins/Temporal/Duration/prototype/add/relativeto-string-zoneddatetime.js
- test/built-ins/Temporal/Duration/prototype/add/timezone-getpossibleinstantsfor-iterable.js
- test/built-ins/Temporal/Duration/prototype/add/timezone-string-datetime.js
- test/built-ins/Temporal/Duration/prototype/round/calendar-fields-iterable.js
- test/built-ins/Temporal/Duration/prototype/round/read-time-fields-before-datefromfields.js
- test/built-ins/Temporal/Duration/prototype/round/relativeto-infinity-throws-rangeerror.js
- test/built-ins/Temporal/Duration/prototype/round/relativeto-propertybag-timezone-getoffsetnanosecondsfor-non-integer.js
- test/built-ins/Temporal/Duration/prototype/round/relativeto-propertybag-timezone-getoffsetnanosecondsfor-out-of-range.js
- test/built-ins/Temporal/Duration/prototype/round/relativeto-propertybag-timezone-getoffsetnanosecondsfor-wrong-type.js
- test/built-ins/Temporal/Duration/prototype/round/relativeto-string-datetime.js
- test/built-ins/Temporal/Duration/prototype/round/relativeto-string-plaindatetime.js
- test/built-ins/Temporal/Duration/prototype/round/relativeto-string-zoneddatetime.js
- test/built-ins/Temporal/Duration/prototype/round/timezone-getpossibleinstantsfor-iterable.js
- test/built-ins/Temporal/Duration/prototype/round/timezone-string-datetime.js
- test/built-ins/Temporal/Duration/prototype/subtract/calendar-fields-iterable.js
- test/built-ins/Temporal/Duration/prototype/subtract/read-time-fields-before-datefromfields.js
@@ -1143,36 +1143,18 @@ test/built-ins/RegExp/prototype/exec/u-lastindex-adv.js:
test/built-ins/RegExp/quantifier-integer-limit.js:
default: 'SyntaxError: Invalid regular expression: number too large in {} quantifier'
strict mode: 'SyntaxError: Invalid regular expression: number too large in {} quantifier'
test/built-ins/Temporal/Duration/from/order-of-operations.js:
default: 'Test262Error: Expected [get years, get years.valueOf, call years.valueOf, get months, get months.valueOf, call months.valueOf, get weeks, get weeks.valueOf, call weeks.valueOf, get days, get days.valueOf, call days.valueOf, get hours, get hours.valueOf, call hours.valueOf, get minutes, get minutes.valueOf, call minutes.valueOf, get seconds, get seconds.valueOf, call seconds.valueOf, get milliseconds, get milliseconds.valueOf, call milliseconds.valueOf, get microseconds, get microseconds.valueOf, call microseconds.valueOf, get nanoseconds, get nanoseconds.valueOf, call nanoseconds.valueOf] and [get days, get days.valueOf, call days.valueOf, get hours, get hours.valueOf, call hours.valueOf, get microseconds, get microseconds.valueOf, call microseconds.valueOf, get milliseconds, get milliseconds.valueOf, call milliseconds.valueOf, get minutes, get minutes.valueOf, call minutes.valueOf, get months, get months.valueOf, call months.valueOf, get nanoseconds, get nanoseconds.valueOf, call nanoseconds.valueOf, get seconds, get seconds.valueOf, call seconds.valueOf, get weeks, get weeks.valueOf, call weeks.valueOf, get years, get years.valueOf, call years.valueOf] to have the same contents. order of operations'
strict mode: 'Test262Error: Expected [get years, get years.valueOf, call years.valueOf, get months, get months.valueOf, call months.valueOf, get weeks, get weeks.valueOf, call weeks.valueOf, get days, get days.valueOf, call days.valueOf, get hours, get hours.valueOf, call hours.valueOf, get minutes, get minutes.valueOf, call minutes.valueOf, get seconds, get seconds.valueOf, call seconds.valueOf, get milliseconds, get milliseconds.valueOf, call milliseconds.valueOf, get microseconds, get microseconds.valueOf, call microseconds.valueOf, get nanoseconds, get nanoseconds.valueOf, call nanoseconds.valueOf] and [get days, get days.valueOf, call days.valueOf, get hours, get hours.valueOf, call hours.valueOf, get microseconds, get microseconds.valueOf, call microseconds.valueOf, get milliseconds, get milliseconds.valueOf, call milliseconds.valueOf, get minutes, get minutes.valueOf, call minutes.valueOf, get months, get months.valueOf, call months.valueOf, get nanoseconds, get nanoseconds.valueOf, call nanoseconds.valueOf, get seconds, get seconds.valueOf, call seconds.valueOf, get weeks, get weeks.valueOf, call weeks.valueOf, get years, get years.valueOf, call years.valueOf] to have the same contents. order of operations'
test/built-ins/Temporal/Duration/prototype/round/calendar-fields-iterable.js:
default: 'Test262Error: fields() method called once Expected SameValue(«0», «1») to be true'
strict mode: 'Test262Error: fields() method called once Expected SameValue(«0», «1») to be true'
test/built-ins/Temporal/Duration/prototype/round/timezone-getpossibleinstantsfor-iterable.js:
default: 'Test262Error: getPossibleInstantsFor() method called correct number of times Expected SameValue(«0», «4») to be true'
strict mode: 'Test262Error: getPossibleInstantsFor() method called correct number of times Expected SameValue(«0», «4») to be true'
test/built-ins/Temporal/Duration/prototype/with/order-of-operations.js:
default: 'Test262Error: Expected [get years, get years.valueOf, call years.valueOf, get months, get months.valueOf, call months.valueOf, get weeks, get weeks.valueOf, call weeks.valueOf, get days, get days.valueOf, call days.valueOf, get hours, get hours.valueOf, call hours.valueOf, get minutes, get minutes.valueOf, call minutes.valueOf, get seconds, get seconds.valueOf, call seconds.valueOf, get milliseconds, get milliseconds.valueOf, call milliseconds.valueOf, get microseconds, get microseconds.valueOf, call microseconds.valueOf, get nanoseconds, get nanoseconds.valueOf, call nanoseconds.valueOf] and [get days, get days.valueOf, call days.valueOf, get hours, get hours.valueOf, call hours.valueOf, get microseconds, get microseconds.valueOf, call microseconds.valueOf, get milliseconds, get milliseconds.valueOf, call milliseconds.valueOf, get minutes, get minutes.valueOf, call minutes.valueOf, get months, get months.valueOf, call months.valueOf, get nanoseconds, get nanoseconds.valueOf, call nanoseconds.valueOf, get seconds, get seconds.valueOf, call seconds.valueOf, get weeks, get weeks.valueOf, call weeks.valueOf, get years, get years.valueOf, call years.valueOf] to have the same contents. order of operations'
strict mode: 'Test262Error: Expected [get years, get years.valueOf, call years.valueOf, get months, get months.valueOf, call months.valueOf, get weeks, get weeks.valueOf, call weeks.valueOf, get days, get days.valueOf, call days.valueOf, get hours, get hours.valueOf, call hours.valueOf, get minutes, get minutes.valueOf, call minutes.valueOf, get seconds, get seconds.valueOf, call seconds.valueOf, get milliseconds, get milliseconds.valueOf, call milliseconds.valueOf, get microseconds, get microseconds.valueOf, call microseconds.valueOf, get nanoseconds, get nanoseconds.valueOf, call nanoseconds.valueOf] and [get days, get days.valueOf, call days.valueOf, get hours, get hours.valueOf, call hours.valueOf, get microseconds, get microseconds.valueOf, call microseconds.valueOf, get milliseconds, get milliseconds.valueOf, call milliseconds.valueOf, get minutes, get minutes.valueOf, call minutes.valueOf, get months, get months.valueOf, call months.valueOf, get nanoseconds, get nanoseconds.valueOf, call nanoseconds.valueOf, get seconds, get seconds.valueOf, call seconds.valueOf, get weeks, get weeks.valueOf, call weeks.valueOf, get years, get years.valueOf, call years.valueOf] to have the same contents. order of operations'
test/built-ins/Temporal/PlainTime/from/argument-string-with-calendar.js:
default: 'RangeError: invalid time string'
strict mode: 'RangeError: invalid time string'
test/built-ins/Temporal/PlainTime/from/options-undefined.js:
default: 'TypeError: "second" field is missing'
strict mode: 'TypeError: "second" field is missing'
test/built-ins/Temporal/PlainTime/from/order-of-operations.js:
default: 'Test262Error: Expected [get calendar, get hour, get hour.valueOf, call hour.valueOf, get minute, get minute.valueOf, call minute.valueOf, get second, get second.valueOf, call second.valueOf, get millisecond, get millisecond.valueOf, call millisecond.valueOf, get microsecond, get microsecond.valueOf, call microsecond.valueOf, get nanosecond, get nanosecond.valueOf, call nanosecond.valueOf] and [get calendar, get hour, get hour.valueOf, call hour.valueOf, get microsecond, get microsecond.valueOf, call microsecond.valueOf, get millisecond, get millisecond.valueOf, call millisecond.valueOf, get minute, get minute.valueOf, call minute.valueOf, get nanosecond, get nanosecond.valueOf, call nanosecond.valueOf, get second, get second.valueOf, call second.valueOf] to have the same contents. order of operations'
strict mode: 'Test262Error: Expected [get calendar, get hour, get hour.valueOf, call hour.valueOf, get minute, get minute.valueOf, call minute.valueOf, get second, get second.valueOf, call second.valueOf, get millisecond, get millisecond.valueOf, call millisecond.valueOf, get microsecond, get microsecond.valueOf, call microsecond.valueOf, get nanosecond, get nanosecond.valueOf, call nanosecond.valueOf] and [get calendar, get hour, get hour.valueOf, call hour.valueOf, get microsecond, get microsecond.valueOf, call microsecond.valueOf, get millisecond, get millisecond.valueOf, call millisecond.valueOf, get minute, get minute.valueOf, call minute.valueOf, get nanosecond, get nanosecond.valueOf, call nanosecond.valueOf, get second, get second.valueOf, call second.valueOf] to have the same contents. order of operations'
default: 'TypeError: "microsecond" field is missing'
strict mode: 'TypeError: "microsecond" field is missing'
test/built-ins/Temporal/PlainTime/from/overflow-undefined.js:
default: 'TypeError: "minute" field is missing'
strict mode: 'TypeError: "minute" field is missing'
default: 'TypeError: "microsecond" field is missing'
strict mode: 'TypeError: "microsecond" field is missing'
test/built-ins/Temporal/PlainTime/from/overflow-wrong-type.js:
default: 'TypeError: "minute" field is missing'
strict mode: 'TypeError: "minute" field is missing'
test/built-ins/Temporal/PlainTime/prototype/add/order-of-operations.js:
default: 'Test262Error: Expected [get years, get years.valueOf, call years.valueOf, get months, get months.valueOf, call months.valueOf, get weeks, get weeks.valueOf, call weeks.valueOf, get days, get days.valueOf, call days.valueOf, get hours, get hours.valueOf, call hours.valueOf, get minutes, get minutes.valueOf, call minutes.valueOf, get seconds, get seconds.valueOf, call seconds.valueOf, get milliseconds, get milliseconds.valueOf, call milliseconds.valueOf, get microseconds, get microseconds.valueOf, call microseconds.valueOf, get nanoseconds, get nanoseconds.valueOf, call nanoseconds.valueOf] and [get days, get days.valueOf, call days.valueOf, get hours, get hours.valueOf, call hours.valueOf, get microseconds, get microseconds.valueOf, call microseconds.valueOf, get milliseconds, get milliseconds.valueOf, call milliseconds.valueOf, get minutes, get minutes.valueOf, call minutes.valueOf, get months, get months.valueOf, call months.valueOf, get nanoseconds, get nanoseconds.valueOf, call nanoseconds.valueOf, get seconds, get seconds.valueOf, call seconds.valueOf, get weeks, get weeks.valueOf, call weeks.valueOf, get years, get years.valueOf, call years.valueOf] to have the same contents. order of operations'
strict mode: 'Test262Error: Expected [get years, get years.valueOf, call years.valueOf, get months, get months.valueOf, call months.valueOf, get weeks, get weeks.valueOf, call weeks.valueOf, get days, get days.valueOf, call days.valueOf, get hours, get hours.valueOf, call hours.valueOf, get minutes, get minutes.valueOf, call minutes.valueOf, get seconds, get seconds.valueOf, call seconds.valueOf, get milliseconds, get milliseconds.valueOf, call milliseconds.valueOf, get microseconds, get microseconds.valueOf, call microseconds.valueOf, get nanoseconds, get nanoseconds.valueOf, call nanoseconds.valueOf] and [get days, get days.valueOf, call days.valueOf, get hours, get hours.valueOf, call hours.valueOf, get microseconds, get microseconds.valueOf, call microseconds.valueOf, get milliseconds, get milliseconds.valueOf, call milliseconds.valueOf, get minutes, get minutes.valueOf, call minutes.valueOf, get months, get months.valueOf, call months.valueOf, get nanoseconds, get nanoseconds.valueOf, call nanoseconds.valueOf, get seconds, get seconds.valueOf, call seconds.valueOf, get weeks, get weeks.valueOf, call weeks.valueOf, get years, get years.valueOf, call years.valueOf] to have the same contents. order of operations'
default: 'TypeError: "microsecond" field is missing'
strict mode: 'TypeError: "microsecond" field is missing'
test/built-ins/Temporal/PlainTime/prototype/equals/argument-wrong-type.js:
default: 'TypeError: "hour" field is missing'
strict mode: 'TypeError: "hour" field is missing'
@@ -1188,9 +1170,6 @@ test/built-ins/Temporal/PlainTime/prototype/toLocaleString/options-conflict.js:
test/built-ins/Temporal/PlainTime/prototype/toLocaleString/options-undefined.js:
default: 'TypeError: Temporal.PlainTime.prototype.valueOf must not be called. To compare PlainTime values, use Temporal.PlainTime.compare'
strict mode: 'TypeError: Temporal.PlainTime.prototype.valueOf must not be called. To compare PlainTime values, use Temporal.PlainTime.compare'
test/built-ins/Temporal/PlainTime/prototype/with/order-of-operations.js:
default: 'Test262Error: Expected [get calendar, get timeZone, get hour, get hour.valueOf, call hour.valueOf, get minute, get minute.valueOf, call minute.valueOf, get second, get second.valueOf, call second.valueOf, get millisecond, get millisecond.valueOf, call millisecond.valueOf, get microsecond, get microsecond.valueOf, call microsecond.valueOf, get nanosecond, get nanosecond.valueOf, call nanosecond.valueOf] and [get calendar, get timeZone, get hour, get hour.valueOf, call hour.valueOf, get microsecond, get microsecond.valueOf, call microsecond.valueOf, get millisecond, get millisecond.valueOf, call millisecond.valueOf, get minute, get minute.valueOf, call minute.valueOf, get nanosecond, get nanosecond.valueOf, call nanosecond.valueOf, get second, get second.valueOf, call second.valueOf] to have the same contents. order of operations'
strict mode: 'Test262Error: Expected [get calendar, get timeZone, get hour, get hour.valueOf, call hour.valueOf, get minute, get minute.valueOf, call minute.valueOf, get second, get second.valueOf, call second.valueOf, get millisecond, get millisecond.valueOf, call millisecond.valueOf, get microsecond, get microsecond.valueOf, call microsecond.valueOf, get nanosecond, get nanosecond.valueOf, call nanosecond.valueOf] and [get calendar, get timeZone, get hour, get hour.valueOf, call hour.valueOf, get microsecond, get microsecond.valueOf, call microsecond.valueOf, get millisecond, get millisecond.valueOf, call millisecond.valueOf, get minute, get minute.valueOf, call minute.valueOf, get nanosecond, get nanosecond.valueOf, call nanosecond.valueOf, get second, get second.valueOf, call second.valueOf] to have the same contents. order of operations'
test/built-ins/Temporal/getOwnPropertyNames.js:
default: 'Test262Error: length Expected SameValue(«5», «11») to be true'
strict mode: 'Test262Error: length Expected SameValue(«5», «11») to be true'
@@ -1,3 +1,34 @@
2021-10-07 Philip Chimento <pchimento@igalia.com>

[JSC] Temporal tweaks to pass more test262 tests
https://bugs.webkit.org/show_bug.cgi?id=231331

Reviewed by Yusuke Suzuki.

* runtime/ISO8601.h:
(JSC::ISO8601::Duration::operator[]): Add an overload for Duration[]
that indexes by TemporalUnit enum instead of integer index.
(JSC::ISO8601::Duration::operator[] const):
* runtime/TemporalDuration.cpp:
(JSC::TemporalDuration::fromDurationLike): Access Duration properties in
the order defined in the specification.
(JSC::TemporalDuration::with const): Access Duration properties in the
order defined in the specification.
(JSC::TemporalDuration::round const): Temporarily throw an exception
here instead of failing an assertion, when attempting to use
unimplemented relativeTo functionality.
* runtime/TemporalObject.cpp:
(JSC::temporalUnitPluralPropertyName): Rename from
temporalUnitPropertyName.
(JSC::temporalUnitSingularPropertyName): Added.
* runtime/TemporalObject.h: Add array corresponding to the table in the
spec text specifying alphabetical access order for unit properties.
* runtime/TemporalPlainTime.cpp:
(JSC::toTemporalTimeRecord): Access PlainTime properties in the order
defined in the specification.
(JSC::toPartialTime): Access PlainTime properties in the order defined
in the specification.

2021-10-06 Fujii Hironori <Hironori.Fujii@sony.com>

Python 3: run-inspector-generator-tests and generate-inspector-protocol-bindings.py
@@ -61,6 +61,8 @@ class Duration {

double& operator[](size_t i) { return m_data[i]; }
const double& operator[](size_t i) const { return m_data[i]; }
double& operator[](TemporalUnit u) { return m_data[static_cast<uint8_t>(u)]; }
const double& operator[](TemporalUnit u) const { return m_data[static_cast<uint8_t>(u)]; }
const_iterator begin() const { return m_data.begin(); }
const_iterator end() const { return m_data.end(); }
void clear() { m_data.fill(0); }

0 comments on commit 79ff5b5

Please sign in to comment.