Commit Graph

6121 Commits

Author SHA1 Message Date
José Julián Espina 4a6439e4a7
Add `Array.prototype.includes` and `exponentiation` features (#3799) 2023-03-23 10:51:08 +01:00
Ms2ger 9704d7f22f
Add tests for the asyncItems argument to Array.fromAsync. (#3754)
Co-authored-by: Philip Chimento <pchimento@igalia.com>
2023-03-10 11:46:59 +01:00
Aditi 53e5ef817e Add Temporal era/eraYear tests 2023-03-07 16:00:10 -08:00
Philip Chimento c4d8f01d3d Array.fromAsync: Tests for mapfn and thisArg arguments
- normal case with synchronous and asynchronous mapfn
- a non-callable value is passed as mapfn
- behaviour of various values of thisArg in strict and sloppy mode
- mapfn result is awaited once per iteration
- iterator is closed when mapfn throws
2023-03-07 11:13:00 +01:00
Philip Chimento ba1e51c8e7 Fix function-valued properties in propertyBagObserver
A property in the property bag we want to observe may be a function, in
which case we don't want to treat it as a primitive and create a
toPrimitiveObserver for it.

(Also handle the null case, in which we should fall through to return a
toPrimitiveObserver.)
2023-03-07 11:13:00 +01:00
Richard Gibson 4f5eb40ee0 Temporal: Test updates for mergeFields output property order
Normative PR: https://github.com/tc39/proposal-temporal/pull/2505
2023-03-06 14:30:35 -08:00
Philip Chimento 5ea8322b08 Clarify feature flags are per proposal
As per discussion in https://github.com/tc39/test262/pull/3773
2023-03-06 17:31:20 +01:00
Philip Chimento 6bfcab1063 Remove unused "Intl.DateTimeFormat-quarter" feature flag
This was a needs-consensus PR that didn't reach consensus. The
corresponding tests were already removed in f7e6656c.

(Note, the link in the removed comment is wrong; it should point to
https://github.com/tc39/ecma402/issues/374)
2023-03-06 17:31:20 +01:00
Philip Chimento 7a5210deaf Clean up feature flags for proposals in published standard
This moves feature flags to the bottom section, for proposals that have
been included in a published revision of the standard (through ES 2022).
2023-03-06 17:31:20 +01:00
Philip Chimento a58ae41ea7 linter: Fix parsing features.txt
Previously, split() would split on whitespace, then the if-condition would
remove `#` - interpreting every word in every comment in the file as a
potential valid feature flag. We want splitlines() here.

Partial-line comments were inadvertently "supported" before, because of
this bug. Instead, support them explicitly by chopping off a `#`
character, anything after it, and any whitespace immediately preceding it.
2023-03-06 17:31:20 +01:00
Philip Chimento 6e1b737357 linter: Use same Python interpreter when executing script in subprocess
If a specific Python interpreter is used (e.g. by invoking the script with
"/path/to/python run.py") then we should use the same Python interpreter
to execute scripts in subprocesses, not the one from the environment.

The path to the running Python interpreter is given by sys.executable.
2023-03-06 17:31:20 +01:00
Cam d216cc1972 asyncHelpers implementation: Apply suggestions from code review
Co-authored-by: Philip Chimento <philip.chimento@gmail.com>
2023-02-21 11:04:09 -08:00
Cam Tenny eb44f67274 asyncHelpers tests: Address code review feedback 2023-02-21 11:04:09 -08:00
Cam Tenny e0d5b780e7 Update CONTRIBUTING.md to suggest using asyncHelpers 2023-02-21 11:04:09 -08:00
Cam Tenny 4fe158d39d Generated tests for refactoring (IIFE/async function).then(\$DONE, \$DONE); to use asyncTest 2023-02-21 11:04:09 -08:00
Cam Tenny 4d9d5c570d Refactor simple cases of (IIFE/async function).then(\$DONE, \$DONE); to use asyncTest 2023-02-21 11:04:09 -08:00
Cam Tenny 1d116b48a9 harness/asyncHelpers.js: Refactor asyncTest to always return undefined instead of a Promise 2023-02-21 11:04:09 -08:00
Cam Tenny d810c684ae harness/asyncHelpers.js: Refactor assert.throwsAsync to only accept a callable 2023-02-21 11:04:09 -08:00
Cam Tenny 4bd0545b29 harness/asyncHelpers.js: Remove dependency on Promise. 2023-02-21 11:04:09 -08:00
Cam Tenny 98952c3c51 harness/asyncHelpers.js: Refactor assert.throwsAsync to be async function 2023-02-21 11:04:09 -08:00
Cam Tenny 0294bea997 Harness tests for asyncHelpers.js' assert.throwsAsync function 2023-02-21 11:04:09 -08:00
Cam Tenny cb9b45ded2 Harness tests for asyncHelpers.js' asyncTest function 2023-02-21 11:04:09 -08:00
Cam Tenny c056d31b9b Adds harness/asyncHelpers.js: functions asyncTest and assert.throwsAsync, per rfcs/async-helpers.md 2023-02-21 11:04:09 -08:00
Philip Chimento 76a14bf659 Temporal: Tests for reference ISO dates
Tests for the process of calculating the reference ISO day for
Temporal.PlainYearMonth and the reference ISO year for
Temporal.PlainMonthDay.

Normative PR: https://github.com/tc39/proposal-temporal/pull/2475
2023-02-17 09:56:13 +01:00
Philip Chimento a29788dd5d Temporal: Tests for calendar-specific mergeFields
In https://github.com/tc39/proposal-temporal/pull/2474, which achieved
consensus at the TC39 plenary meeting of 2023-01-31, the implementation-
defined steps for Temporal.Calendar.prototype.mergeFields had their
language tightened, to better specify what implementations must do.

This adds tests covering the new spec language, and moves one related test
out of staging.
2023-02-16 12:00:30 -08:00
Philip Chimento 6d7925a2d2 fixup: Changes based on 1st RFC experience 2023-02-15 09:21:07 -08:00
Philip Chimento 44c5e632fd RFC process documentation
This is a process allowing contributors to submit well-motivated
proposals to improve test262 using an RFC (Request For Commments)
process which is adapted from a similar process in the Rust community.
2023-02-15 09:21:07 -08:00
Mike Pennisi 62df2cadef Correct typos 2023-02-15 09:04:26 -08:00
Ms2ger ac098dbe6a Apply suggestions from code review
Co-authored-by: Jordan Harband <ljharb@gmail.com>
Co-authored-by: Philip Chimento <philip.chimento@gmail.com>
2023-02-15 09:04:26 -08:00
Mike Pennisi 97477ad1f6 fixup! Document rationale for some maintenance practices 2023-02-15 09:04:26 -08:00
Mike Pennisi f59823860e fixup! Document rationale for some maintenance practices 2023-02-15 09:04:26 -08:00
Mike Pennisi 17238ca018 fixup! Document rationale for some maintenance practices
Integrate some review feedback
2023-02-15 09:04:26 -08:00
Mike Pennisi 7e190c786d Document rationale for some maintenance practices 2023-02-15 09:04:26 -08:00
Philip Chimento 8ad7d04afa Temporal: Test copying options object in since() and until()
In since() and until() methods, we copy the options object with
CopyDataProperties. Previously, its properties could be read in more than
one place (the method itself, and the calendar method), triggering user
code each time. Now, we pass around null-prototype objects with only data
properties.

See https://github.com/tc39/proposal-temporal/pull/2447
2023-02-14 09:45:43 -08:00
Aditi 1c47728a20 Remove failing tests for CalendarFields and CalendarMergeFields 2023-02-10 17:43:47 -08:00
Romulo Cintra b17b9411e0 Update DurationFormat and FormatToParts tests
https://github.com/tc39/proposal-intl-duration-format/pull/126
2023-02-08 10:53:17 -08:00
James Wright 01425696e6 Push into calls array in calendar and timeZone observers. 2023-02-08 12:29:24 +01:00
Jordan Harband 408ecd0987 ArrayBuffer.prototype.detached tests
See https://tc39.es/proposal-arraybuffer-transfer/
2023-02-08 12:21:03 +01:00
Romulo Cintra 780b7b806e Add test to approximately format 2023-02-07 17:14:06 -08:00
Timothy Flynn f5e2214b30 Swap call order of NumberFormat's notation and roundingIncrement options
The order in which these options are read was changed in commit:
29acfc6c3f
2023-02-07 16:14:13 -08:00
Shu-yu Guo d03f11a81b Fix ArrayBuffer#transfer tests to preserve maxByteLength 2023-02-07 16:00:02 +01:00
Philip Chimento e7364ea7dc Temporal: Tests for upper limit on rounding increments
Previously in a few cases (calendar units in Duration) the value for the
roundingIncrement option had no upper limit, other than having to be
finite. These tests cover a normative change limiting it to 1e9.

Normative PR: https://github.com/tc39/proposal-temporal/pull/2480
2023-02-01 11:50:44 -08:00
Philip Chimento 8aeab83c98 Temporal: Adjustments to order-of-operations tests
The with() methods, as well as PlainYearMonth's since() and until(), were
adjusted to read the receiver's fields before the fields of any objects
provided as arguments. This change is observable, so affects several tests
that test the observed order of operations.

Normative PR: https://github.com/tc39/proposal-temporal/pull/2478
2023-02-01 10:32:07 -08:00
Richard Gibson 788bc809bf
Update DateTimeFormat proleptic Gregorian testing to include era (#3722)
Ref https://github.com/tc39/ecma402/issues/723
2023-02-01 11:50:39 -05:00
Philip Chimento a157570ddc Regularize some of the "calendar-temporal-object" tests
I used a script to "unroll" some of the calls to
TemporalHelpers.checkToTemporalCalendarFastPath(), and rewrite it slightly
not to use a specific Calendar instance. This is in preparation for a
future refactor, but also allows testing the PlainTime path which was not
previously covered.

(I didn't unroll all the calls and remove the helper yet, because the
remaining calls have custom assertions that I haven't gotten the script to
work with yet. For the same reason, I didn't yet convert these to use the
test generation facility. These will follow in a future PR.)
2023-02-01 10:50:12 +01:00
Philip Chimento 374aac475d Regularize "calendar-case-insensitive" tests
For each entry point where a string calendar name is accepted, we should
have a test that ensures the calendar name is case-insensitive. These
tests existed but several were incomplete as they didn't take nested
properties into account, and several entry points were missing this test.

Fix a minor copy-paste issue with double semicolons.
2023-02-01 10:50:12 +01:00
Richard Gibson 8700c92095 Temporal: Remove subsumed intl402 custom Calendar/TimeZone tests 2023-01-31 17:17:28 -08:00
Richard Gibson ea10ca0cc6 Temporal: Add intl402 custom Calendar/TimeZone tests to cover rejection of invalid output 2023-01-31 17:17:28 -08:00
Richard Gibson f9a62a4eb1 Temporal: Update custom Calendar/TimeZone tests to cover rejection of invalid output
Ref https://github.com/tc39/proposal-temporal/issues/2443
2023-01-31 17:17:28 -08:00
Richard Gibson 703873e1ca Test Array.prototype.findLast* length clamping 2023-01-30 15:32:14 +01:00