Commit Graph

5337 Commits

Author SHA1 Message Date
Tim Chevalier 7fb465496f Feedback from code review 2024-10-30 17:18:26 -07:00
Tim Chevalier d2d84950c3 Update test/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-invalid-offset-string.js
Co-authored-by: Philip Chimento <philip.chimento@gmail.com>
2024-10-30 17:18:26 -07:00
Tim Chevalier a93fe76f52 Temporal: Move ZonedDateTime property bag tests out of staging 2024-10-30 17:18:26 -07:00
Tim Chevalier 87344d96f2 Feedback from code review 2024-10-30 17:03:46 -07:00
Tim Chevalier bfb957f669 Temporal: Move more ZonedDateTime tests out of staging 2024-10-30 17:03:46 -07:00
Tim Chevalier 5505758111
Temporal: Fix Temporal/Duration/p/round tests (#4299) 2024-10-30 16:45:28 -07:00
Tim Chevalier 85934bf49c
Temporal: Move tests for ZonedDateTime/p/{add, subtract} out of staging into test/built-ins (#4287) 2024-10-30 16:20:09 -07:00
Ben Allen febf246e05 DurationFormat: Add tests for durations with large hour/minute/second unit values while using digital style
Grouping separators suppressed in this situation. See tc39/proposal-intl-duration-format/pull/198
2024-10-30 16:07:46 -07:00
Tim Chevalier 01dbd4db41 Temporal: Move tests for ZonedDateTime/compare out of staging into test/built-ins 2024-10-30 15:58:23 -07:00
Ben Allen 455cfa5a66
Add tests to `Intl.DateTimeFormat` and `Intl.RelativeTimeFormat` for various numbering systems (#4276)
* Add tests to `Intl.DateTimeFormat` and `Intl.RelativeTimeFormat` for formatting in various numbering systems

* fixup! Add tests to `Intl.DateTimeFormat` and `Intl.RelativeTimeFormat` for formatting in various numbering systems
2024-10-30 15:03:44 -07:00
Ben Allen 153db6ce33 Intl.NumberFormat Add tests for `Intl.NumberFormat` when using "currency" style and "compact", "engineering", and "scientific" notations.
Related PR: https://github.com/tc39/ecma402/pull/925
2024-10-30 14:51:34 -07:00
Tim Chevalier 3f2486e37f
Move all tests from staging/Temporal/Instant/old to test/built-ins/Temporal/Instant (#4282)
* Temporal: Move all tests from staging/Temporal/Instant/old to test/built-ins/Temporal/instant
2024-10-30 14:29:02 -07:00
Tim Chevalier f178db57fe
Temporal: Move all tests out of total.js under staging into separate files under test/built-ins (#4281)
* Temporal: Move most tests out of total.js under staging into separate files under test/built-ins

Co-authored-by: Philip Chimento <philip.chimento@gmail.com>
2024-10-30 11:44:59 -07:00
Tim Chevalier 713ddf66e0
Temporal: Move some tests out of round.js under staging into separate files under test/built-ins (#4280)
Co-authored-by: Philip Chimento <philip.chimento@gmail.com>
2024-10-30 11:32:37 -07:00
Théo LUDWIG 01776c30d3 test(top-level-await): move out of staging module graphs hanging 2024-10-29 19:35:56 +01:00
André Bargull 5b1757743a Update expected formatting for CLDR 46 2024-10-29 12:10:47 +01:00
Tim Chevalier b8c29a05b5 Temporal: Move tests out of staging/Temporal/Duration/old and into test/built-ins 2024-10-28 12:41:47 -07:00
Chengzhong Wu 3f0a24f4f6 [source-phase-imports] update missing source error type 2024-10-25 11:37:04 +02:00
_Kerman 0add42b556
fix: heritage-arrow-function.js (#4273) 2024-10-21 15:54:30 +02:00
Jordan Harband 0645461999 add missing Error.isError feature flag
See https://github.com/tc39/test262/pull/4266#issuecomment-2419000590
2024-10-17 10:57:45 -07:00
Jordan Harband 4b17ad3f3d add `Error.isError` tests
See https://github.com/tc39/proposal-is-error/issues/7
2024-10-15 11:12:39 -07:00
Ioanna M. Dimitriou H 3cacf7d85e Fix CI linting errors 2024-10-15 10:32:14 -07:00
Ioanna M. Dimitriou H 51d86807fe Address review comments 2024-10-15 10:32:14 -07:00
Ioanna M. Dimitriou H 3f8d416bf5 same for isRawJSON's property descriptor test file 2024-10-15 10:32:14 -07:00
Ioanna M. Dimitriou H d103a39e52 Updated placement of tests in rawJSON test files, previous older version was added accidentally. 2024-10-15 10:32:14 -07:00
Ioanna M. Dimitriou H 954d1809f8 Boilerplate tests for rawJSON and isRawJSON
from the proposal json-parse-with-source
2024-10-15 10:32:14 -07:00
André Bargull df910721ba Update time zone mapping for CLDR46 / tzdata 2024b 2024-10-14 11:21:25 -07:00
André Bargull 9b3d9d9700 Update built-ins/Date to verifyProperty 2024-10-14 08:55:14 -07:00
André Bargull d1c2a6f139 Update built-ins/Date/prototype/getXXX to verifyProperty 2024-10-14 08:55:14 -07:00
André Bargull 800d2190b3 Update built-ins/Date/prototype/setXXX to verifyProperty 2024-10-14 08:55:14 -07:00
Meghan Denny 60963bf468
chore: convert many tests to use verifyProperty (#4263)
Co-authored-by: André Bargull <andre.bargull@gmail.com>
2024-10-14 11:25:05 +02:00
Peter Hoddie 83fae7f1f2 a few tests use verifyPrimordialProperty 2024-10-11 12:45:30 -07:00
André Bargull 92b592547d Ensure NaN time values are correctly handled in various Date setters
Related PR: https://github.com/tc39/ecma262/pull/2136
2024-10-11 12:19:13 -07:00
Richard Gibson 5ae7de9942
Increase coverage of String.prototype.replace $xy replacement patterns (#3931)
* $xy is a valid capture index
* $xy is not a valid capture index but $x is
* neither $xy nor $x is a valid capture index
2024-10-10 14:08:45 +02:00
tannal 954d6370f9 Avoid using destructuring in tco-fn-realm.js 2024-10-09 19:52:05 -07:00
André Bargull ab809f8f0c Update tests for "Limit valid values for DurationFormats to match upcoming limits in Temporal"
Update tests for
<https://github.com/tc39/proposal-intl-duration-format/pull/173>.
2024-10-09 19:43:12 -07:00
Chengzhong Wu 0596ff6981 [source-phase-imports] Dynamic import source call
Add source phase import support in import calls with necessary
embedder APIs. When a imported module does not support source phase
representation, a ReferenceError is thrown in d8.

Bug: 42204365
Change-Id: If40cadfcdf0a547f24d20c67149bba559480341d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5878343
Commit-Queue: Chengzhong Wu (legendecas) <legendecas@gmail.com>
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#96473}
2024-10-09 08:18:20 +02:00
Rezvan Mahdavi Hezaveh 6c967a8bbb Remove extra `.js` from file name 2024-10-07 10:58:18 -07:00
Philip Chimento e2f2f92486 Temporal: Add tests for formatting with no overlap between DTF options and Temporal object
See tc39/proposal-temporal#2795. When attempting to format a Temporal
object, if the DateTimeFormat has options that do not overlap with the
data model of the Temporal object, toLocaleString() and format() are
supposed to throw a TypeError.
2024-10-07 12:02:45 +02:00
Philip Chimento eb848bb553 Temporal: Remove incorrect toLocaleString tests
These staging tests are incorrect. See tc39/proposal-temporal#2795. This
was an unintended behaviour. It differed from the behaviour for dateStyle
and timeStyle, which was the intended behaviour.
2024-10-07 12:02:45 +02:00
Philip Chimento 573234fe7b Temporal: Add tests for toLocaleString with no options
For each Temporal object, add tests for what components are present by
default if no options for date or time components are passed.
2024-10-07 12:02:45 +02:00
Philip Chimento 9e6ab9bb02 Temporal: Add coverage for formatting each Temporal object with only one component
Adds a test for each Temporal object's toLocaleString() method, formatting
them with only one option e.g. { year: 'numeric' } and comparing it with
the corresponding output for legacy Date.

See tc39/proposal-temporal#2796.
2024-10-07 12:02:45 +02:00
Philip Chimento 459cef7185 Temporal: Add coverage for validating offset string syntax vs suitability
Syntax is validated first. Only after the property bag is fully converted
into a Calendar Fields Record does the time zone validate whether the UTC
offset is correct for that exact time in the time zone.

See tc39/proposal-temporal#2962
2024-10-07 12:02:45 +02:00
Philip Chimento 6dced5dead Temporal: Add coverage for validating month code syntax vs suitability
Syntax is validated first. Only after the property bag is fully converted
into a Calendar Fields Record does the calendar validate whether the month
code actually exists in the year.

See tc39/proposal-temporal#2962
2024-10-07 12:02:45 +02:00
Philip Chimento 09c7d33253 Temporal: Add coverage for disallowed seconds in offset time zone identifiers
This was an area missing test coverage.
2024-10-07 12:02:45 +02:00
Ioanna M Dimitriou H 1332b14d69
Merge branch 'main' into regex-v-flag-follow-up 2024-10-04 18:33:01 +02:00
tannal d7d02aedca fix errors 2024-10-04 14:13:23 +08:00
Rezvan Mahdavi Hezaveh 06ea308d14 Remove one of the `.js`s from the test name 2024-10-03 16:41:38 -07:00
Philip Chimento f4a987fe3c Temporal: Additional tests for cases where date addition goes out of range
See tc39/proposal-temporal#2985
2024-10-03 12:14:41 +02:00
Philip Chimento 326cdb8da8 Temporal: Consistently test all string entry points for representable range
Remove the existing "instant-string-limits.js" that only applied to APIs
where ToTemporalInstant was called. Add "argument-string-limits.js" tests
everywhere ISO strings are converted.

Related to tc39/proposal-temporal#2985
2024-10-03 12:14:41 +02:00
Philip Chimento 116bc2cc47 Temporal: Move UTC offset ±24:00 into invalid string tests
It was in the "limits of representable range" tests, but it is invalid
syntax, so it belongs somewhere else.
2024-10-03 12:14:41 +02:00
Richard Gibson 585d7ac2b3 Test TypedArrays with excess bytes in their underlying buffers 2024-10-02 16:38:41 -07:00
tannal 5c20b3bd85 Add basic tests with u flag in v flag tests. 2024-09-28 18:12:21 +08:00
Huáng Jùnliàng 1a0aa3b866 fix: syntax error in DisposableStack test 2024-09-27 15:29:36 +02:00
Linus Groh f1a670ff59 Fix compareArray.js harness tests
Also a typo in one of the messages.
2024-09-27 11:43:57 +02:00
Philip Chimento f225229f85 Remove FinalizationRegistry tests that depend on nondeterministic GC
In these tests, cleanupSome() would have optionally emptied the
FinalizationRegistry synchronously and called the finalization callbacks.
Without cleanupSome(), there is no way to observe a FinalizationRegistry
being emptied using "pure" ECMAScript: FinalizationRegistry doesn't get
cleaned up until the microtask queue is empty, and without external APIs
such as setTimeout() there is no way to pause execution until after the
microtask queue is empty.

Non-deterministic tests are not that useful anyway; these tests are
probably better left to implementations' internal testing strategies.
2024-09-25 10:06:15 -07:00
Philip Chimento 77b1c787e8 Remove WeakRef/prototype/deref/gc-cleanup-not-prevented-with-wr-deref.js
On all engines that still support cleanupSome, this test was hitting the
asyncGC.notCollected check in resolveAsyncGC(). That means that it was
just skipped, and the deref() part was never actually executed.

Given that it is not testing anything in practice, remove it.
2024-09-25 10:06:15 -07:00
Philip Chimento 3bed2c446f Remove tests for FinalizationRegistry.prototype.cleanupSome
This proposal was split off from FinalizationRegistry at stage 2, and then
withdrawn. Given that status, it should not be part of the test suite.
2024-09-25 10:06:15 -07:00
SkyCrystal 957ab22773
Add a test for Generator (#3729) 2024-09-25 12:58:24 -04:00
Ioanna M Dimitriou H c63d53ad9c
Builtin boilerplate tests from PR #3866 (#4236)
Includes some proto-from-ctor-realm.js tests that look like standard tests for prototypes.

Co-authored-by: Ron Buckton <ron.buckton@microsoft.com>
Co-authored-by: Philip Chimento <philip.chimento@gmail.com>
2024-09-24 14:04:28 +02:00
Shu-yu Guo fcfb11da77 Remove test for old behavior for Atomics.pause 2024-09-20 15:34:26 -07:00
tannal 474af83250 Add more tests for v flag 2024-09-20 11:10:54 -07:00
Ron Buckton dc7a22dd28 Function branding boilerplate tests from PR #3866 2024-09-20 10:48:23 -07:00
Philip Chimento e46b317b18 Temporal: Add test coverage for canonicalizing era codes in from()
There was a coverage gap for converting calendar fields to a date when the
provided era was an alias.

See https://github.com/tc39/proposal-temporal/pull/2940#discussion_r1767508659
2024-09-20 17:04:19 +02:00
André Bargull 18ae34d8f2 Improve coverage for reference type in various contexts
Missing coverage encountered while implementing
<https://github.com/tc39/ecma262/pull/3307> in SpiderMonkey.

Ensure environment lookups are performed in the correct order:
- keyed-destructuring-property-reference-target-evaluation-order-with-bindings.js

Ensure `delete super[elem]` steps are correctly performed:
- delete/super-property-topropertykey.js
- delete/super-property-uninitialized-this.js

Ensure ToPropertyKey for computed property names in object literals
correctly performed:
- object/computed-property-name-topropertykey-before-value-evaluation.js

Ensure `GetSuperBase` is executed before `ToPropertKey`:
- super/prop-expr-getsuperbase-before-topropertykey-*

Ensure `GetThisBinding` is executed first:
- super/prop-expr-uninitialized-this-*
2024-09-20 16:00:53 +02:00
Richard Gibson de3a117f02 Temporal: Update tests to account for use of year in ToTemporalMonthDay
Ref https://github.com/tc39/proposal-temporal/issues/2863
Normative PR: https://github.com/tc39/proposal-temporal/pull/2940
2024-09-19 11:27:48 -07:00
Rezvan Mahdavi Hezaveh dfece8cfc5 [explicit-resource-management] Add test for async generator body
This cl adds a test for having `await using` in the async
generator function body.

Bug: 42203814
Change-Id: I30c0d2fe354a3047f67a4a71f7c6472c3d832bbf
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5867651
Commit-Queue: Rezvan Mahdavi Hezaveh <rezvan@chromium.org>
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#96146}
2024-09-17 22:20:04 +02:00
André Bargull 867ca540d6 Add test coverage for correct binding object MOP executions in with-environment 2024-09-13 12:28:45 -07:00
SUZUKI Sosuke 8cbcc309e6
Add tests for `%WrapForValidIteratorPrototype%.return()` from Iterator Helpers Proposal (#4214)
* Add tests for `%WrapForValidIteratorPrototype%.return()`

* Address review

- Remove unused `flags
- Do not use `deepEqual.js`
- Assert `return` never got when `this` value is invalid
- Use `TemporalHelpers` to observer get / call
2024-09-13 11:41:43 -07:00
Mathias Bynens 77e98fb683 Add tests for Unicode v16 property escapes
Issue: https://github.com/tc39/ecma262/issues/3425
2024-09-13 14:42:42 +02:00
Mathias Bynens 83c58c5055 Move updated `unicodeSets` tests to their appropriate location 2024-09-13 14:38:51 +02:00
Mathias Bynens 4bdf978220 Add tests for Unicode v16 Identifier{Start,Part}
Issue: https://github.com/tc39/ecma262/issues/3425

.
2024-09-12 08:48:21 -07:00
Shu-yu Guo a9c1c08852
Migrate resizable buffer tests out of staging (#3888)
Co-authored-by: Ioanna M Dimitriou H <idimitriou@igalia.com>
2024-09-12 11:26:33 +02:00
Paul Bakker 98c7e9114e
Test computed accessor properties and AggregateError constructor without arguments (#4222) 2024-09-11 11:41:07 +02:00
Philip Chimento 70cdc562e3 Temporal: Adjust era code of Japanese pre-Meiji era
As of the current state of the Intl Era and Month Codes proposal,
https://tc39.es/proposal-intl-era-monthcode/#sec-temporal-canonicalizeeraincalendar
the canonical name of this era is "japanese".

See: https://github.com/tc39/proposal-temporal/issues/2901
2024-09-10 09:28:24 -07:00
Philip Chimento 6f8f6b5261 Temporal: Tests for ignoring era and eraYear in calendars without eras
This tests some of the prose requirements of CalendarResolveFields.

See https://github.com/tc39/proposal-temporal/issues/2870
2024-09-10 09:28:24 -07:00
Aapo Alasuutari cff5a6012f
fix: Use Object.getPrototypeOf to get prototype in `__proto__-fn-name.js` (#4205) 2024-09-09 14:37:00 +02:00
Philip Chimento d9b10790bc Temporal: Tests for corner case in TZDB involving DST transition in 1919
These tests add coverage for a corner case in the TZDB. In spring 1919,
the America/Toronto time zone switched to DST at 23:30 on March 30th,
skipping an hour ahead to 00:30 on March 31st. This meant that both March
30th and March 31st were 23.5-hour days.

See: https://github.com/tc39/proposal-temporal/issues/2910
2024-09-05 15:19:17 -07:00
Philip Chimento c93ae0ac2f Temporal: Tests for disallowed corner case in rounding durations
This test covers a normative change to disallow an ambiguous corner case
in the options bag for Temporal.Duration.prototype.round().

See https://github.com/tc39/proposal-temporal/pull/2916
2024-09-05 15:08:08 -07:00
Ioanna M Dimitriou H fc49c9ce16
Move function MayNeedBigInt to RAB helper file and inline WriteToTypedArray. (#4211) 2024-09-03 16:23:23 +02:00
Nicolò Ribaudo d012a4d0ef
Add test for asi between `get`/`set` field and generator (#4189)
Co-authored-by: André Bargull <andre.bargull@gmail.com>
Co-authored-by: Linus Groh <mail@linusgroh.de>
2024-09-02 17:39:12 +02:00
Rezvan Mahdavi Hezaveh d62fa93c8f [explicit-resource-management] Complete exception handling
This CL completes the exception handling (promise rejection) for
async explicit resource management.

Bug: 42203814
Change-Id: Ide4f05df14f74e68b7aa120230f1b1ae33ce8adc
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5692882
Commit-Queue: Rezvan Mahdavi Hezaveh <rezvan@chromium.org>
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#95748}
2024-08-28 19:39:52 +02:00
Rezvan Mahdavi Hezaveh 9f94490ff1
Merge branch 'main' into chromium-export-99eec8f4a2 2024-08-28 09:51:29 -07:00
Rezvan Mahdavi Hezaveh b69e9d5e72 [explicit-resource-management] Add AsyncDisposableStack builtins
This CL adds builtin methods for developer exposed
AsyncDisposableStack object.

Bug: 42203814
Change-Id: I1f16a3bcb80c71a4f33e4ae028f1737c3502dabe
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5715141
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Rezvan Mahdavi Hezaveh <rezvan@chromium.org>
Cr-Commit-Position: refs/heads/main@{#95838}
2024-08-27 21:23:09 +02:00
Ioanna M Dimitriou H 3acb672d11
RAB: Integrate helper to rest of the tests (#4198)
Co-authored-by: Philip Chimento <philip.chimento@gmail.com>
2024-08-27 17:18:44 +02:00
André Bargull a4443793b9 Add coverage when array buffer is resized in SetTypedArrayFromArrayLike 2024-08-27 15:24:28 +02:00
André Bargull 18c8c85746 Add more tests for deleted bindings in object environments 2024-08-27 15:24:28 +02:00
André Bargull b9ed8c920c Add more tests for typed array indices in typed array set 2024-08-27 15:24:28 +02:00
Philip Chimento ea11e0e787 Temporal: Further coverage and tweaks for removing Calendar/TimeZone objs
Tweak some tests to provide coverage of new execution paths in the spec,
such as calling GetOptionsObject inside ToTemporal___; add a few new tests
for things that weren't covered before, such as rounding a PlainDateTime
at the edge of the range; and tweak the tests verifying when the
properties of the options bag are read, which I made a mistake in #4119.

See: https://github.com/tc39/proposal-temporal/pull/2925
2024-08-22 14:00:43 -07:00
Jonatan Klemets 3b4d9f53b5 Remove README about keeping import-assertions tests in sync 2024-08-22 12:19:08 -07:00
Jonatan Klemets 3b56bf655f Remove generated import-assertions test files
Generated by running `./make.py clean` and `./make.py`
2024-08-22 12:19:08 -07:00
Jonatan Klemets cfd81e1698 Remove import-assertions test files 2024-08-22 12:19:08 -07:00
Luis Fernando Pardo Sixtos 2e1843d0a5 [decorators] Support public auto-accessors
Add support for the accessor keywords for public class fields as part of the decorators proposal.

Changes to the parser:

- Minor cleanup of reused code.
- Support declaration of public auto-accessors.

Changes to the bytecode generator:
- Add logic to create the accessor storage private name for public
  members.
- Add the generated getter and setter to the arguments list passed to
  Runtime::kDefineClass

Changes to class boilerplate:

- Add logic to add a template AccessorPair to the descriptors lists
  for each auto accessor property. The template AccessorPair object
  is initialized with consecutive indices corresponding to the
  positions in the Runtime::kDefineClass arguments.

Add tests.

Bug: 42202709
Change-Id: I2253eddb734e950d8faf83fff1763e32b7f53a73
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5745256
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Reviewed-by: Seth Brenith <seth.brenith@microsoft.com>
Commit-Queue: Luis Pardo <lpardosixtos@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#95784}
2024-08-22 20:23:01 +02:00
Richard Gibson b70b75793d Test `await` in ConditionalExpression 2024-08-21 10:19:55 +02:00
Michael Ficarra 22967c5b7b Math.sqrt: add a test with exact input-output expectations 2024-08-20 10:29:05 -07:00
José Julián Espina dde3050bdb
Fix test regression in asyncHelpers.js (#4197) 2024-08-19 12:33:17 -04:00
Ms2ger 941813e1f0 Revert "Revert "Add invalid index Reflect.set tests""
This reverts commit b110681292.
2024-08-16 17:26:15 +02:00
Ms2ger 79faa2252a Revert "Revert "Add invalid index prototype chain [[Set]] tests""
This reverts commit 3d77404e4f.
2024-08-16 17:26:15 +02:00
Ms2ger 44685c14d7 Revert "Revert "Add valid index Reflect.set tests""
This reverts commit b90326d9a4.
2024-08-16 17:26:15 +02:00
Ms2ger efa4272ffb Revert "Revert "Add valid index prototype chain [[Set]] tests""
This reverts commit bd65623af6.
2024-08-16 17:26:15 +02:00