2953 Commits

Author SHA1 Message Date
André Bargull
55e4c18a69 Replace "closed" global variable in Math.sumPrecise test
This allows running the test in browsers, too.

<https://developer.mozilla.org/en-US/docs/Web/API/Window/closed>.
2025-11-10 09:41:50 -08:00
Philip Chimento
5c07b52242 Temporal: Remove accidental octal literals from a test
These cause the test to fail in strict mode.
2025-11-06 11:32:55 +01:00
Tim Chevalier
aa62607560 Fix indentation 2025-11-04 12:52:31 -08:00
Tim Chevalier
67ccaf966a Avoid creating extra objects 2025-11-04 12:52:31 -08:00
Tim Chevalier
88c06fe752 Update test/built-ins/Temporal/Instant/prototype/toString/negative-instant-rounding.js
Co-authored-by: Ms2ger <Ms2ger@gmail.com>
2025-11-04 12:52:31 -08:00
Tim Chevalier
d50ce09c59 Fix lint errors 2025-11-04 12:52:31 -08:00
Tim Chevalier
f1828f3ebf Add tests that trigger the same bug from Instant.toString and ZonedDateTime.toString 2025-11-04 12:52:31 -08:00
Tim Chevalier
ef55820458 Add tests for PlainDateTime and ZonedDateTime as well 2025-11-04 12:52:31 -08:00
Tim Chevalier
4d9f01fcf4 Temporal: Add a test for rounding negative instants 2025-11-04 12:52:31 -08:00
Philip Chimento
6600ea1042 Temporal: Add coverage for another large-subseconds addition bug
Bug observed in the proposal-temporal reference code, caused by improper
implementation of AddTime
(https://tc39.es/proposal-temporal/#sec-temporal-addtime) where the
advice in Step 2 was not followed correctly.

See https://github.com/tc39/proposal-temporal/pull/3173
2025-11-03 11:35:50 +01:00
Philip Chimento
d8c989cc8a Temporal: Consolidate "large-subseconds" and "large-milliseconds" tests
These (from #4619 and #4625) are very similar and I'm also going to add
more cases to them in the next commit.

Also add similar tests to Instant and PlainTime.
2025-11-03 11:35:50 +01:00
Philip Chimento
a9251b7718 Temporal: Add tests for internal representation of Duration
The spec describes the internal representation of Duration as float64-
representable integers. There are a few tricky ways that it is
observable if an implementation does not do this correctly. Here are
some tests for them.
2025-11-03 10:30:08 +01:00
Tim Chevalier
66bf8b8b52
Temporal: Add coverage for adding durations with large subsecond values to a PlainTime (#4625)
* Temporal: Add coverage for adding durations with large subsecond values to a PlainTime

* Add tests for PlainDateTime and ZonedDateTime
2025-10-31 13:36:32 -07:00
Tim Chevalier
678c434dab Temporal: Add tests for correct rounding of epoch milliseconds in toString() 2025-10-31 11:36:50 +01:00
Philip Chimento
18f6ed2627 Add missing quotation mark in assertion message 2025-10-30 17:51:51 +01:00
Philip Chimento
0e496d5808 Minor updates to text in Temporal calendar-wrong-type tests
These were missed in https://github.com/tc39/test262/pull/4415
2025-10-30 17:51:51 +01:00
Philip Chimento
85ae4c0966 Temporal: Add tests for optional properties in property bags
These tests confirm that Temporal-object-like property bags have the
correct default values for their optional properties.

This provides coverage for a V8 bug:
https://issues.chromium.org/issues/446728405
2025-10-30 17:40:54 +01:00
Philip Chimento
e72321987e Temporal: Add tests for serialization of durations with pairs of units
These check that durations with large and small units are properly
serialized.
2025-10-30 16:27:33 +01:00
Tim Chevalier
61d0eb9167
Temporal: Add an overflow test for date addition with maximum year (#4618)
* Temporal: Add an overflow test for date addition with maximum year

* Add tests for other cases

* Fix minimum dates

* Add cases for adding/subtracting the negated duration to the opposite end of the allowed years
2025-10-29 18:04:05 -07:00
Tim Chevalier
759fe87f1c Temporal: Add coverage for adding large microseconds/nanoseconds values
Add coverage for adding unbalanced durations with large microseconds
or nanoseconds values to a PlainDateTime or ZonedDateTime.
2025-10-29 17:30:09 -07:00
Duncan MacGregor
c588df6367
Add coverage for Object.assign with an array target (#4603) 2025-10-29 16:06:50 -04:00
duncan.macgregor
15ab1bd12f Fix and tighten up cross realm %ThrowTypeError% test. 2025-10-29 08:41:22 -07:00
André Bargull
e7ddbfac99
Add test for trailing garbage handling in setFromBase64 (#4605) 2025-10-29 15:38:05 +00:00
Richard Gibson
687cf880eb
Temporal: Add tests for PlainMonthDay.from with month and invalid monthCode (#4597) 2025-10-15 18:56:49 +00:00
Sosuke Suzuki
432bc2b863 Add assertions for checking names of resolve and reject 2025-10-06 12:45:03 +02:00
Ben Noordhuis
2e7412547d Test iterator close behavior of Set methods
Set.prototype.isDisjointFrom and Set.prototype.isSupersetOf should call
return() on the set-like iterator but only when it is not exhausted.

Port of the downstream tests I added in quickjs-ng/quickjs@6167dcb127.
2025-09-30 11:57:20 +02:00
jugglinmike
8a8a7af1b9
Classify tests for the stability of array sorting (#4569)
* Classify tests for the stability of array sorting

These tests were originally introduced via
https://github.com/tc39/test262/pull/1977 &
https://github.com/tc39/test262/pull/2062 and subsequently modified via
https://github.com/tc39/test262/pull/2169.

* fixup! Classify tests for the stability of array sorting
2025-09-25 16:26:49 -04:00
André Bargull
5155b2ad7e Add test case when countBytes in TA.p.slice is set to zero
`countBytes` can be set to zero in step 14.d when resizable array
buffers are used.
2025-09-25 17:49:06 +02:00
Ben Noordhuis
409001b61b Make iterator sequencing test more explicit
The next() method is not supposed to get called. Per discussion here:
https://github.com/tc39/test262/pull/4326#discussion_r2371763680
2025-09-23 16:25:54 -07:00
Linus Groh
e0d8f66a2b Add missing include to WeakMap.prototype.getOrInsertComputed() test 2025-09-18 13:35:51 -07:00
Philip Chimento
af3d908437 Temporal: Add tests covering one operand of ZonedDateTime difference at extreme
These tests cover the case where the ZonedDateTime since() or until()
methods are called with either the receiver or the argument being a
ZonedDateTime instance at either the earliest or latest end of the
supported range.
2025-09-16 10:42:10 +02:00
Philip Chimento
35b3fc74ab Revert "fix another test now that we don't access the IteratorResult value"
This reverts commit 71794b138844536a36b341700f88ee91c5754431.

Follow up from #4523, missed reverting this commit.

Closes: #4581
2025-09-16 10:17:18 +02:00
Jonas Haukenes
55e8077819 Added missing feature; symbols-as-weakmap-keys 2025-09-15 11:03:07 -07:00
Trevor Florence
0b02980322
Add additional tests for copy by array features (#4576)
Addresses testing gaps identified in #4575
2025-09-15 10:55:13 -07:00
Jonas Haukenes
daa4186be4 Removed typeof from log message. 2025-09-15 14:55:44 +02:00
Jonas Haukenes
557b748bff Modifed the test to verify that callbackfn is not called if the key cannot be held weakly. 2025-09-15 14:55:44 +02:00
Trevor Florence
a5e69a1534 Remove unnecessary call to compareArray in this-value-boolean.js
This assertion throws before `compareArray` is called. In addition, `compareArray` takes two parameters, not one.

It's unclear to me why it was added in the first place.
2025-09-10 08:50:24 -07:00
Richard Gibson
3fd4ec27f1
[immutable-arraybuffer] Changes to existing ArrayBuffer.prototype properties (#4540) 2025-08-27 19:23:40 -04:00
Ms2ger
6f74a55277 Fix c/p errors in String#{is,to}WellFormed tests 2025-08-27 12:15:53 +02:00
Richard Gibson
c185485452 [immutable-arraybuffer] DataView.prototype.set$Type 2025-08-25 15:24:20 -07:00
Philip Chimento
04eaeb9908 Temporal: Coverage for blank durations
Many methods did not test what happened when an input or return value
was a blank (all fields 0) duration. This adds coverage for those code
paths.
2025-08-25 11:56:33 +02:00
Michael Ficarra
b947715fdd update Iterator Sequencing tests to reflect May 2025 plenary updates 2025-08-22 16:06:55 +02:00
Philip Chimento
5048ca6383 Temporal: Add tests for observable order of options get and cast
These tests cover the normative change approved in the July 2025 TC39
plenary. See https://github.com/tc39/proposal-temporal/pull/3130.
All properties of user-passed options objects should be read and cast
before any "algorithmic validation" is done.

This is a lot of tests, that cover every entry point where an options
object is passed in, where subsequently an exception can be thrown or user
code can be called.

However, the normative change only affects 10 of these tests:

- Instant.p.since,until,toString
- PlainDate.p.since,until
- PlainTime.p.since,until
- PlainYearMonth.p.since,until
- ZonedDateTime.p.toString

The other 35 tests simply close a gap in coverage.
2025-08-21 12:01:52 -07:00
Philip Chimento
1588705cc5 Temporal: Add coverage for BubbleRelativeDuration called with time unit
See: tc39/proposal-temporal#3121

A type assertion in the spec was incorrect, but the assertion wasn't hit
in the Firefox implementation in any test262 test. These three tests add
coverage for all the paths that would have hit that assertion.
2025-08-20 18:02:05 +02:00
Daniel Minor
d0cb9f80f7 Add symbols-as-weakmap-keys to features 2025-08-19 17:21:01 +02:00
Richard Gibson
7a2273abd2
Fix typos (#4552)
Ref #4550
2025-07-31 12:07:48 -04:00
Richard Gibson
4868f0f66c [TypedArray.prototype.copyWithin] Cover overlapping source/destination ranges
Ref https://github.com/tc39/ecma262/pull/3619
Ref https://github.com/tc39/ecma262/issues/3618
2025-07-29 11:04:58 +02:00
Richard Gibson
e5731d6fa7 [TypedArray.prototype.copyWithin] Refactor coerced-target-start-end-shrink.js 2025-07-29 11:04:58 +02:00
Daniel Minor
6a73fa8f11
Move WeakMap.prototype.getOrInsertComputed tests from staging to built-ins 2025-06-09 09:45:43 -04:00
Timothy Flynn
f0dc15c6c7 Add missing include to Uint8Array/fromBase64/last-chunk-invalid.js 2025-07-08 17:51:33 +02:00