Commit Graph

120 Commits

Author SHA1 Message Date
Philip Chimento dc0082c5ea Remove unused test fixtures
These belong to a test that is not imported.
2024-12-09 13:35:08 -08:00
Ms2ger 6ee9579acb Import tests from SpiderMonkey 2024-12-09 13:35:08 -08:00
Shu-yu Guo 05c45a4c43 [rab/gsab] Return false in [[PreventExtensions]] for variable-length TAs
This is a spec normative change: https://github.com/tc39/ecma262/pull/3453

Fixed: 374310073
Change-Id: I085260fea077bc27cf1e4f06d4389519e12c4e14
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6014979
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Auto-Submit: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Rezvan Mahdavi Hezaveh <rezvan@chromium.org>
Reviewed-by: Rezvan Mahdavi Hezaveh <rezvan@chromium.org>
Cr-Commit-Position: refs/heads/main@{#97166}
2024-11-13 22:22:11 +01:00
Ioanna M Dimitriou H 437f9a7631
Migrate staging tests for JSON-parse-with-source (#4265)
Co-authored-by: Philip Chimento <pchimento@igalia.com>
Co-authored-by: Ms2ger <Ms2ger@igalia.com>
2024-11-06 16:59:30 +01:00
Tim Chevalier b7822bb0b8
Temporal: Move tests for ZonedDateTime/p/{since, until} out of staging (#4293)
Co-authored-by: Philip Chimento <philip.chimento@gmail.com>
2024-11-01 11:02:32 -07:00
Tim Chevalier ccf8977b1c Temporal: Split up ZonedDateTime/old/string-parsing.js and move out of staging 2024-10-31 16:05:30 -07:00
Tim Chevalier 8cc0560713
Temporal: Move all tests out of ZonedDateTime/old/with.js under staging into separate files under test/built-ins (#4297)
Co-authored-by: Philip Chimento <philip.chimento@gmail.com>
2024-10-31 13:34:57 -07:00
Tim Chevalier 0f6b269400 Temporal: Move ZonedDateTime order-of-operations tests out of staging 2024-10-31 13:13:20 -07:00
Tim Chevalier bf46ed66b6 Temporal: move tests for ZonedDateTime/p/{toInstant, toPlainDate, toPlainTime, toString} 2024-10-31 13:08:38 -07:00
Tim Chevalier 7a4426e2b2 Temporal: Move remaining tests from Temporal/ZonedDateTime/old under staging into separate files under test/built-ins
Includes withPlainDateTime and withTimeZone
2024-10-31 11:58:25 -07:00
Tim Chevalier de68177f59 Temporal: Move ZonedDateTime/prototype/round tests and one other ZonedDateTime test out of staging 2024-10-30 17:58:43 -07:00
Tim Chevalier a93fe76f52 Temporal: Move ZonedDateTime property bag tests out of staging 2024-10-30 17:18:26 -07:00
Tim Chevalier bfb957f669 Temporal: Move more ZonedDateTime tests out of staging 2024-10-30 17:03:46 -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
Tim Chevalier 01dbd4db41 Temporal: Move tests for ZonedDateTime/compare out of staging into test/built-ins 2024-10-30 15:58:23 -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
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
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
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
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
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
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
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
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
Luis Fernando Pardo Sixtos 2020cfbe66 [decorators] Support private auto-accessors
Support for the accessor keywords for private class fields as part of
the decorators proposal.

Changes to AST:

- Add an AUTO_ACCESSOR value to the ClassLiteralProperty::Kind enum.
- Add an AutoAccessorInfo class to be used in ClassLiteralProperty
  objects of kind AUTO_ACCESSOR to hold the information about the
  generated getters/setters and backing storage.
- Add AutoAccessorGetterBody and AutoAccessorSetterBody statements to
  implement the logic of generated getters and setters.

Changes to Parser:
- Add logic to parse the "accessor" keyword and throw when used on non
  field class properties.
- Add preparser logic to mock the function scopes and variable
  declarations required for the generated getters/setters.
- Add parser logic to synthetically create statements for the
  generated setters/getters. 

Changes to the Bytecode Generator:
- Add logic to BuildClassLiteral to build auto accessor storage
  private names.
- Add logic to set the generated getters/setters in the accessor pair.
- Add logic to initialize the accessor storage in BuildClassProperty.
- Add AutoAccessorGetterBody and AutoAccessorSetterBody visitors.

Tests:
- Add parsing-unittests for parsing converage.
- Add test262 tests for functionality coverage.
- Add test-debug test for devtools support coverage.

Bug: 42202709
Change-Id: Ibb9bee3bbd0c09341108856f969e0c22bbb8b9cc
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5547688
Reviewed-by: Seth Brenith <seth.brenith@microsoft.com>
Commit-Queue: Luis Pardo <lpardosixtos@microsoft.com>
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#95612}
2024-08-13 19:35:08 +02:00
Philip Chimento 3b89be9c5d Temporal: Fix Japanese era test
This mistakenly used a previous name for the helper function. Also adds
a couple of debugging messages.
2024-07-29 14:17:24 +02:00
André Bargull 7f81bb2126 Allow canonical era codes for Japanese era test 2024-07-25 11:59:15 -07:00
André Bargull a238ad6a1e Move test for dates before start of the Japanese era into a new file
See also <https://github.com/tc39/proposal-temporal/issues/2865>
requesting for more information how this case should actually be
handled.
2024-07-25 11:59:15 -07:00
Rezvan Mahdavi Hezaveh 97e0bef215 [explicit-resource-management] Add await using to the bytecode generator
This CL adds subtypes (SyncJSDisposableStack and AsyncDisposableStack)
to JSDisposableStack as well as `await using` to the bytecode generator.
Currently async generators are broken and the fix is left as a TODO
in this CL. Also, exception handling (promise rejections) will be
completed in a follow up CL.

Bug: 42203814
Change-Id: I303a380b57fb4ab4662e4f55fb4dc9b14d18cd2a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5569647
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Rezvan Mahdavi Hezaveh <rezvan@chromium.org>
Cr-Commit-Position: refs/heads/main@{#94944}
2024-07-10 10:19:19 -07:00
André Bargull 0ff7881d75 Use explicit relative paths 2024-07-10 16:02:53 +02:00
Philip Chimento cb13595617 Temporal: Add staging test to check June 2024 API removals
This test should trip if an implementation forgets to perform the removals
that reached consensus in June 2024. (Although such an implementation
would technically comply with the specification, if you really need to do
that, please open an issue on the Temporal proposal repo rather than just
skiplisting this test.)
2024-07-05 10:43:53 +02:00
Philip Chimento bbfcfd59b0 Temporal: Port staging tests that require non-ISO calendar or non-UTC time zone
As in the previous commit, without custom calendars and time zones, some
functionality cannot be tested on implementations that don't have any
other calendars and time zones than iso8601 and UTC.

Some of the staging tests fall in this category. We take the opportunity
to port these into proper tests, in the intl402/ folder.
2024-07-05 10:43:53 +02:00
Philip Chimento efc7424844 Temporal: Don't use getISOFields() in other tests
Previously getISOFields() was used to get the exact value of the
[[Calendar]] and [[TimeZone]] internal slots, as well as to get the
reference ISO year for PlainMonthDay and reference ISO day for
PlainYearMonth.

Use calendarId and timeZoneId for the former and toString() for the
latter.
2024-07-05 10:43:53 +02:00
Philip Chimento 9671c4a613 Temporal: Test adjustments for removing calendar and time zone objects 2024-07-05 10:43:53 +02:00
Philip Chimento 7d970fbe4e Temporal: Remove fake West Coast and Samoa time zones from TemporalHelpers
It's no longer possible to fake built-in time zones using custom objects.
So testing DST shifts will have to use real built-in time zones. Replace
TemporalHelpers.springForwardFallBackTimeZone with America/Vancouver (it
was modelled on the DST transitions in 2000) and
TemporalHelpers.crossDateLineTimeZone with Pacific/Apia (it was modelled
on the 2011 switch to the other side of the international date line.)

These tests have to move to the intl402/ folder since non-Intl-aware
implementations are allowed (but not required) to support any built-in
time zones other than UTC.
2024-07-05 10:43:53 +02:00
Philip Chimento c728e6d89e Temporal: Fix tests that unnecessarily create TimeZone or Calendar instances
In many cases we created a TimeZone or Calendar instance from a built-in
time zone or calendar. These tests can be trivially adapted to just use
the string ID.
2024-07-05 10:43:53 +02:00
Philip Chimento ea2268aa43 Temporal: Remove tests directly relating to custom calendar and time zones
These are tests that just won't apply anymore without custom calendars and
time zones.
2024-07-05 10:43:53 +02:00
Philip Chimento 1213ab17ec Temporal: Remove getCalendar and getTimeZone methods
Temporarily replace them with getISOFields().calendar/timeZone just to
keep the tests running until we remove Calendar and TimeZone objects
altogether.

See: tc39/proposal-temporal#2826
2024-07-05 10:43:53 +02:00
Philip Chimento c22fbc7b45 Temporal: Port staging tests that use next/previousTransition
See: tc39/proposal-temporal#2826
2024-07-05 10:43:53 +02:00
Philip Chimento 3f805a1383 Temporal: Test calendar canonicalization in Temporal
Following the upstream ECMA-402 change tested in the previous commit, add
test coverage for the corresponding functionality in Temporal. Fix one
test that was erroneous.
2024-07-04 11:14:16 +02:00
Philip Chimento 6626b60df6 Temporal: Make U+2212 MINUS SIGN invalid in ISO strings
These are the test adjustments corresponding to the normative PR
https://github.com/tc39/ecma262/pull/3334 which reached consensus at the
June 2024 TC39 meeting.
2024-07-03 08:50:57 -07:00
Shu-yu Guo 29c6f7028a [top-level-await] Sync implementation with spec text
The module evaluation machinery has undergone non-trivial refactoring
since implementation. Sync up the comments and code for maintenance.

Notably,

- Actually use the kEvaluatingAsync status (previously conflated under
  kEvaluated)
- [[IsAsyncEvaluating]] -> [[IsAsyncEvaluation]]
- GatherAsyncParentCompletions -> GatherAvailableAncestors
- async -> has_toplevel_await
- kAsyncModule -> kModuleWithTopLevelAwait

Bug: 347060515
Change-Id: Ia2c35d5b42ee9f58db841cdfcaef9d17b018c9c6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5636701
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#94591}
2024-06-21 23:23:02 +02:00