Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions third_party/test262/test/built-ins/Number/MAX_VALUE/value.js
Original file line number Diff line number Diff line change
@@ -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");
20 changes: 20 additions & 0 deletions third_party/test262/test/built-ins/Number/MIN_VALUE/value.js
Original file line number Diff line number Diff line change
@@ -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");
Original file line number Diff line number Diff line change
@@ -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 }));
});
Original file line number Diff line number Diff line change
@@ -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 }));
});
Original file line number Diff line number Diff line change
Expand Up @@ -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]`);
Original file line number Diff line number Diff line change
@@ -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 }));
});
Original file line number Diff line number Diff line change
@@ -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 }));
});
Original file line number Diff line number Diff line change
@@ -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]`);
18 changes: 18 additions & 0 deletions third_party/test262/test/staging/set-is-subset-of-empty-index.js
Original file line number Diff line number Diff line change
@@ -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);
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
description: |
pending
esid: pending
features: [Atomics, SharedArrayBuffer]
---*/

const otherGlobal = $262.createRealm().global;
Expand Down Expand Up @@ -111,4 +112,3 @@ for (let TA of intArrayConstructors) {
assert.sameValue(val, 3);
assert.sameValue(ta[0], 2);
}

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ includes: [detachArrayBuffer.js]
description: |
pending
esid: pending
features: [Atomics]
---*/

const intArrayConstructors = [
Expand Down Expand Up @@ -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)));
}

Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -136,4 +137,3 @@ for (const [TA, taLength] of prod(floatConstructors, typedArrayLengths)) {
assert.sameValue(fta[nanOffset + i], NaN, `At offset: ${nanOffset + i}`);
}
}

1 change: 1 addition & 0 deletions third_party/test262/test/staging/sm/TypedArray/toString.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ includes: [sm/non262-TypedArray-shell.js, propertyHelper.js]
description: |
pending
esid: pending
features: [Float16Array]
---*/
const TypedArrayPrototype = Object.getPrototypeOf(Int8Array.prototype);

Expand Down
2 changes: 1 addition & 1 deletion third_party/test262/vendored.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[test262]
source = "https://github.com/tc39/test262"
rev = "b66872a92487694396fb082343e08dd7cca5ddf4"
rev = "d0c1b4555b03dd404873fd6422a4b5da00136500"