From 3f6571b1c4cd9c852271f158dc32d5e69709b2fd Mon Sep 17 00:00:00 2001 From: wpt-pr-bot Date: Sun, 3 May 2026 12:27:05 +0000 Subject: [PATCH] Update Test262 tests --- .../test/built-ins/Number/MAX_VALUE/value.js | 19 ++++++++++++++++ .../test/built-ins/Number/MIN_VALUE/value.js | 20 +++++++++++++++++ ...ndate-large-time-component-out-of-range.js | 22 +++++++++++++++++++ ...etime-large-time-component-out-of-range.js | 22 +++++++++++++++++++ .../round/rounding-increment-relativeto.js | 5 ----- ...ndate-large-time-component-out-of-range.js | 22 +++++++++++++++++++ ...etime-large-time-component-out-of-range.js | 22 +++++++++++++++++++ .../round/rounding-increment-relativeto.js | 16 ++++++++++++++ .../staging/set-is-subset-of-empty-index.js | 18 +++++++++++++++ .../staging/sm/Atomics/cross-compartment.js | 2 +- .../staging/sm/Atomics/detached-buffers.js | 2 +- .../sm/TypedArray/sort-negative-nan.js | 2 +- .../test/staging/sm/TypedArray/toString.js | 1 + third_party/test262/vendored.toml | 2 +- 14 files changed, 166 insertions(+), 9 deletions(-) create mode 100644 third_party/test262/test/built-ins/Number/MAX_VALUE/value.js create mode 100644 third_party/test262/test/built-ins/Number/MIN_VALUE/value.js create mode 100644 third_party/test262/test/built-ins/Temporal/Duration/prototype/round/relativeto-plaindate-large-time-component-out-of-range.js create mode 100644 third_party/test262/test/built-ins/Temporal/Duration/prototype/round/relativeto-zoneddatetime-large-time-component-out-of-range.js create mode 100644 third_party/test262/test/built-ins/Temporal/Duration/prototype/total/relativeto-plaindate-large-time-component-out-of-range.js create mode 100644 third_party/test262/test/built-ins/Temporal/Duration/prototype/total/relativeto-zoneddatetime-large-time-component-out-of-range.js create mode 100644 third_party/test262/test/intl402/Temporal/Duration/prototype/round/rounding-increment-relativeto.js create mode 100644 third_party/test262/test/staging/set-is-subset-of-empty-index.js diff --git a/third_party/test262/test/built-ins/Number/MAX_VALUE/value.js b/third_party/test262/test/built-ins/Number/MAX_VALUE/value.js new file mode 100644 index 00000000000000..82f46335d7bea0 --- /dev/null +++ b/third_party/test262/test/built-ins/Number/MAX_VALUE/value.js @@ -0,0 +1,19 @@ +// Copyright (C) 2026 Luna Pfeiffer. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-number.max_value +description: > + Number.MAX_VALUE is approximately 1.7976931348623157 × 10³⁰⁸ + +---*/ + + +assert.sameValue(typeof Number.MAX_VALUE, "number", "Number.MAX_VALUE should be a number"); +assert(Number.MAX_VALUE > 0, "Number.MAX_VALUE must be positive"); + +assert(Number.MAX_VALUE > Number.MAX_SAFE_INTEGER, "Number.MAX_VALUE should be larger than Number.MAX_SAFE_INTEGER"); +assert(Number.MAX_VALUE < Infinity, "Number.MAX_VALUE should be less than Infinity"); + +assert.sameValue(Number.MAX_VALUE * 2, Infinity, "Number.MAX_VALUE multiplied by 2 should be Infinity"); +assert.sameValue(Number.MAX_VALUE, 1.7976931348623157e+308, "Number.MAX_VALUE should be approximately 1.7976931348623157e+308"); diff --git a/third_party/test262/test/built-ins/Number/MIN_VALUE/value.js b/third_party/test262/test/built-ins/Number/MIN_VALUE/value.js new file mode 100644 index 00000000000000..33b0baae4a0142 --- /dev/null +++ b/third_party/test262/test/built-ins/Number/MIN_VALUE/value.js @@ -0,0 +1,20 @@ +// Copyright (C) 2026 Luna Pfeiffer. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-number.min_value +description: > + Number.MIN_VALUE is approximately 5e-324. We can't directly compare it as the spec states: + + In the IEEE 754-2019 double precision binary representation, the smallest possible value is a denormalized number. + If an implementation does not support denormalized values, the value of Number.MIN_VALUE must be the smallest + non-zero positive value that can actually be represented by the implementation. +---*/ + + +assert.sameValue(typeof Number.MIN_VALUE, "number", "Number.MIN_VALUE should be a number"); +assert(Number.MIN_VALUE > 0, "Number.MIN_VALUE must be positive"); + +assert(Number.MIN_VALUE < Number.EPSILON, "Number.MIN_VALUE should be smaller than Number.EPSILON") + +assert.sameValue(Number.MIN_VALUE / 2, 0, "Number.MIN_VALUE divided by 2 should underflow to 0"); diff --git a/third_party/test262/test/built-ins/Temporal/Duration/prototype/round/relativeto-plaindate-large-time-component-out-of-range.js b/third_party/test262/test/built-ins/Temporal/Duration/prototype/round/relativeto-plaindate-large-time-component-out-of-range.js new file mode 100644 index 00000000000000..8c73d1d67b4ed3 --- /dev/null +++ b/third_party/test262/test/built-ins/Temporal/Duration/prototype/round/relativeto-plaindate-large-time-component-out-of-range.js @@ -0,0 +1,22 @@ +// Copyright (C) 2026 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.duration.prototype.round +description: > + Duration with an overly large time component rounded to a calendar unit + relative to a PlainDate +info: | + 28.d. Let _dateDuration_ be ? AdjustDateDurationRecord( + _internalDuration_.[[Date]], _targetTime_.[[Days]]). +features: [Temporal] +---*/ + +const relativeTo = new Temporal.PlainDate(2020, 1, 1); + +[Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER].forEach((seconds) => { + const d = new Temporal.Duration(0, 0, 0, 0, 0, 0, seconds); + assert.throws(RangeError, () => d.round({ smallestUnit: "year", relativeTo })); + assert.throws(RangeError, () => d.round({ smallestUnit: "month", relativeTo })); + assert.throws(RangeError, () => d.round({ smallestUnit: "week", relativeTo })); +}); diff --git a/third_party/test262/test/built-ins/Temporal/Duration/prototype/round/relativeto-zoneddatetime-large-time-component-out-of-range.js b/third_party/test262/test/built-ins/Temporal/Duration/prototype/round/relativeto-zoneddatetime-large-time-component-out-of-range.js new file mode 100644 index 00000000000000..52fee7c3456f7e --- /dev/null +++ b/third_party/test262/test/built-ins/Temporal/Duration/prototype/round/relativeto-zoneddatetime-large-time-component-out-of-range.js @@ -0,0 +1,22 @@ +// Copyright (C) 2026 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.duration.prototype.round +description: > + Duration with an overly large time component rounded to a calendar unit + relative to a ZonedDateTime +info: | + 27.e. Let _targetEpochNs_ be ? AddZonedDateTime(_relativeEpochNs_, _timeZone_, + _calendar_, _internalDuration_, ~constrain~). +features: [Temporal] +---*/ + +const relativeTo = new Temporal.ZonedDateTime(0n, "UTC"); + +[Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER].forEach((seconds) => { + const d = new Temporal.Duration(0, 0, 0, 0, 0, 0, seconds); + assert.throws(RangeError, () => d.round({ smallestUnit: "year", relativeTo })); + assert.throws(RangeError, () => d.round({ smallestUnit: "month", relativeTo })); + assert.throws(RangeError, () => d.round({ smallestUnit: "week", relativeTo })); +}); diff --git a/third_party/test262/test/built-ins/Temporal/Duration/prototype/round/rounding-increment-relativeto.js b/third_party/test262/test/built-ins/Temporal/Duration/prototype/round/rounding-increment-relativeto.js index 762be1f1d5bba1..1e66b492d05f40 100644 --- a/third_party/test262/test/built-ins/Temporal/Duration/prototype/round/rounding-increment-relativeto.js +++ b/third_party/test262/test/built-ins/Temporal/Duration/prototype/round/rounding-increment-relativeto.js @@ -39,8 +39,3 @@ TemporalHelpers.assertDuration(new Temporal.Duration(0, 1, 0, 30).round({ roundingIncrement: 2, relativeTo: new Temporal.PlainDate(1970, 7, 31) }), 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, `1m30d to 2m with relativeTo 1970-07-31`); -TemporalHelpers.assertDuration(new Temporal.Duration(0, 1, 0, 30).round({ - smallestUnit: "months", - roundingIncrement: 2, - relativeTo: Temporal.ZonedDateTime.from('2025-03-09T03:00:00-07:00[America/Vancouver]') -}), 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, `1m30d to 2m with relativeTo 2025-03-09T03:00:00-07:00[America/Vancouver]`); diff --git a/third_party/test262/test/built-ins/Temporal/Duration/prototype/total/relativeto-plaindate-large-time-component-out-of-range.js b/third_party/test262/test/built-ins/Temporal/Duration/prototype/total/relativeto-plaindate-large-time-component-out-of-range.js new file mode 100644 index 00000000000000..220eec68218f8c --- /dev/null +++ b/third_party/test262/test/built-ins/Temporal/Duration/prototype/total/relativeto-plaindate-large-time-component-out-of-range.js @@ -0,0 +1,22 @@ +// Copyright (C) 2026 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.duration.prototype.total +description: > + Duration with an overly large time component total of a calendar unit relative + to a PlainDate +info: | + 13.d. Let _dateDuration_ be ? AdjustDateDurationRecord( + _internalDuration_.[[Date]], _targetTime_.[[Days]]). +features: [Temporal] +---*/ + +const relativeTo = new Temporal.PlainDate(2020, 1, 1); + +[Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER].forEach((seconds) => { + const d = new Temporal.Duration(0, 0, 0, 0, 0, 0, seconds); + assert.throws(RangeError, () => d.total({ unit: "year", relativeTo })); + assert.throws(RangeError, () => d.total({ unit: "month", relativeTo })); + assert.throws(RangeError, () => d.total({ unit: "week", relativeTo })); +}); diff --git a/third_party/test262/test/built-ins/Temporal/Duration/prototype/total/relativeto-zoneddatetime-large-time-component-out-of-range.js b/third_party/test262/test/built-ins/Temporal/Duration/prototype/total/relativeto-zoneddatetime-large-time-component-out-of-range.js new file mode 100644 index 00000000000000..0457eaf86b8838 --- /dev/null +++ b/third_party/test262/test/built-ins/Temporal/Duration/prototype/total/relativeto-zoneddatetime-large-time-component-out-of-range.js @@ -0,0 +1,22 @@ +// Copyright (C) 2026 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.duration.prototype.total +description: > + Duration with an overly large time component total of a calendar unit relative + to a ZonedDateTime +info: | + 12.e. Let _targetEpochNs_ be ? AddZonedDateTime(_relativeEpochNs_, _timeZone_, + _calendar_, _internalDuration_, ~constrain~). +features: [Temporal] +---*/ + +const relativeTo = new Temporal.ZonedDateTime(0n, "UTC"); + +[Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER].forEach((seconds) => { + const d = new Temporal.Duration(0, 0, 0, 0, 0, 0, seconds); + assert.throws(RangeError, () => d.total({ unit: "year", relativeTo })); + assert.throws(RangeError, () => d.total({ unit: "month", relativeTo })); + assert.throws(RangeError, () => d.total({ unit: "week", relativeTo })); +}); diff --git a/third_party/test262/test/intl402/Temporal/Duration/prototype/round/rounding-increment-relativeto.js b/third_party/test262/test/intl402/Temporal/Duration/prototype/round/rounding-increment-relativeto.js new file mode 100644 index 00000000000000..b50c5d7e3cb1a3 --- /dev/null +++ b/third_party/test262/test/intl402/Temporal/Duration/prototype/round/rounding-increment-relativeto.js @@ -0,0 +1,16 @@ +// Copyright (C) 2026 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.duration.prototype.round +description: Test a specific buggy case from temporal_rs +includes: [temporalHelpers.js] +features: [Temporal] +---*/ + +const relativeTo = Temporal.ZonedDateTime.from('2025-03-09T03:00:00-07:00[America/Vancouver]'); +TemporalHelpers.assertDuration(new Temporal.Duration(0, 1, 0, 30).round({ + smallestUnit: "months", + roundingIncrement: 2, + relativeTo, +}), 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, `1m30d to 2m with relativeTo 2025-03-09T03:00:00-07:00[America/Vancouver]`); diff --git a/third_party/test262/test/staging/set-is-subset-of-empty-index.js b/third_party/test262/test/staging/set-is-subset-of-empty-index.js new file mode 100644 index 00000000000000..07706fe9dc0fc9 --- /dev/null +++ b/third_party/test262/test/staging/set-is-subset-of-empty-index.js @@ -0,0 +1,18 @@ +// Copyright (C) 2023 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: https://github.com/tc39/proposal-set-methods/pull/102 +features: [set-methods] +---*/ + +let firstSet = new Set('a', 'b'); +let secondSet = { + size: 3, + has() { + firstSet.delete('b'); + firstSet.add('c'); + return true; + }, + * keys() {} +}; +assert.sameValue(firstSet.isSubsetOf(secondSet), true); diff --git a/third_party/test262/test/staging/sm/Atomics/cross-compartment.js b/third_party/test262/test/staging/sm/Atomics/cross-compartment.js index 2606709b850ad6..4dd3fe77775b65 100644 --- a/third_party/test262/test/staging/sm/Atomics/cross-compartment.js +++ b/third_party/test262/test/staging/sm/Atomics/cross-compartment.js @@ -5,6 +5,7 @@ description: | pending esid: pending +features: [Atomics, SharedArrayBuffer] ---*/ const otherGlobal = $262.createRealm().global; @@ -111,4 +112,3 @@ for (let TA of intArrayConstructors) { assert.sameValue(val, 3); assert.sameValue(ta[0], 2); } - diff --git a/third_party/test262/test/staging/sm/Atomics/detached-buffers.js b/third_party/test262/test/staging/sm/Atomics/detached-buffers.js index 9d0e605c2793c7..d1b1bf3ce31a8e 100644 --- a/third_party/test262/test/staging/sm/Atomics/detached-buffers.js +++ b/third_party/test262/test/staging/sm/Atomics/detached-buffers.js @@ -6,6 +6,7 @@ includes: [detachArrayBuffer.js] description: | pending esid: pending +features: [Atomics] ---*/ const intArrayConstructors = [ @@ -97,4 +98,3 @@ for (let TA of intArrayConstructors) { assert.throws(TypeError, () => Atomics.xor(ta, badValue(ta), 0)); assert.throws(TypeError, () => Atomics.xor(ta, 0, badValue(ta))); } - diff --git a/third_party/test262/test/staging/sm/TypedArray/sort-negative-nan.js b/third_party/test262/test/staging/sm/TypedArray/sort-negative-nan.js index 00e1c6c070c298..c5e0f433017679 100644 --- a/third_party/test262/test/staging/sm/TypedArray/sort-negative-nan.js +++ b/third_party/test262/test/staging/sm/TypedArray/sort-negative-nan.js @@ -6,6 +6,7 @@ includes: [sm/non262-TypedArray-shell.js] description: | pending esid: pending +features: [Float16Array, Float32Array, Float64Array] ---*/ // Test with all floating point typed arrays. const floatConstructors = anyTypedArrayConstructors.filter(isFloatConstructor); @@ -136,4 +137,3 @@ for (const [TA, taLength] of prod(floatConstructors, typedArrayLengths)) { assert.sameValue(fta[nanOffset + i], NaN, `At offset: ${nanOffset + i}`); } } - diff --git a/third_party/test262/test/staging/sm/TypedArray/toString.js b/third_party/test262/test/staging/sm/TypedArray/toString.js index 29adb9038ba34b..2b4d27d99a9067 100644 --- a/third_party/test262/test/staging/sm/TypedArray/toString.js +++ b/third_party/test262/test/staging/sm/TypedArray/toString.js @@ -6,6 +6,7 @@ includes: [sm/non262-TypedArray-shell.js, propertyHelper.js] description: | pending esid: pending +features: [Float16Array] ---*/ const TypedArrayPrototype = Object.getPrototypeOf(Int8Array.prototype); diff --git a/third_party/test262/vendored.toml b/third_party/test262/vendored.toml index 11954844c86b41..ee8550f90d9f1f 100644 --- a/third_party/test262/vendored.toml +++ b/third_party/test262/vendored.toml @@ -1,3 +1,3 @@ [test262] source = "https://github.com/tc39/test262" -rev = "b66872a92487694396fb082343e08dd7cca5ddf4" +rev = "d0c1b4555b03dd404873fd6422a4b5da00136500"