| all-negative.js |
---
esid: sec-temporal.duration.prototype.with
description: >
Returns a correctly merged object when the argument replaces the fields with
all negative values.
info: |
1. Let duration be the this value.
2. Perform ? RequireInternalSlot(duration, [[InitializedTemporalDuration]]).
3. Let temporalDurationLike be ? ToPartialDuration(temporalDurationLike).
4. If temporalDurationLike.[[Years]] is not undefined, then
a. Let years be temporalDurationLike.[[Years]].
5. Else,
a. Let years be duration.[[Years]].
6. If temporalDurationLike.[[Months]] is not undefined, then
a. Let months be temporalDurationLike.[[Months]].
7. Else,
a. Let months be duration.[[Months]].
8. If temporalDurationLike.[[Weeks]] is not undefined, then
a. Let weeks be temporalDurationLike.[[Weeks]].
9. Else,
a. Let weeks be duration.[[Weeks]].
10. If temporalDurationLike.[[Days]] is not undefined, then
a. Let days be temporalDurationLike.[[Days]].
11. Else,
a. Let days be duration.[[Days]].
12. If temporalDurationLike.[[Hours]] is not undefined, then
a. Let hours be temporalDurationLike.[[Hours]].
13. Else,
a. Let hours be duration.[[Hours]].
14. If temporalDurationLike.[[Minutes]] is not undefined, then
a. Let minutes be temporalDurationLike.[[Minutes]].
15. Else,
a. Let minutes be duration.[[Minutes]].
16. If temporalDurationLike.[[Seconds]] is not undefined, then
a. Let seconds be temporalDurationLike.[[Seconds]].
17. Else,
a. Let seconds be duration.[[Seconds]].
18. If temporalDurationLike.[[Milliseconds]] is not undefined, then
a. Let milliseconds be temporalDurationLike.[[Milliseconds]].
19. Else,
a. Let milliseconds be duration.[[Milliseconds]].
20. If temporalDurationLike.[[Microseconds]] is not undefined, then
a. Let microseconds be temporalDurationLike.[[Microseconds]].
21. Else,
a. Let microseconds be duration.[[Microseconds]].
22. If temporalDurationLike.[[Nanoseconds]] is not undefined, then
a. Let nanoseconds be temporalDurationLike.[[Nanoseconds]].
23. Else,
a. Let nanoseconds be duration.[[Nanoseconds]].
24. Return ? CreateTemporalDuration(years, months, weeks, days, hours, minutes, seconds, milliseconds, microseconds, nanoseconds).
features: [Temporal]
includes: [temporalHelpers.js]
--- |
3645 |
- |
| all-positive.js |
---
esid: sec-temporal.duration.prototype.with
description: >
Returns a correctly merged object when the argument replaces the fields with
all positive values.
info: |
1. Let duration be the this value.
2. Perform ? RequireInternalSlot(duration, [[InitializedTemporalDuration]]).
3. Let temporalDurationLike be ? ToPartialDuration(temporalDurationLike).
4. If temporalDurationLike.[[Years]] is not undefined, then
a. Let years be temporalDurationLike.[[Years]].
5. Else,
a. Let years be duration.[[Years]].
6. If temporalDurationLike.[[Months]] is not undefined, then
a. Let months be temporalDurationLike.[[Months]].
7. Else,
a. Let months be duration.[[Months]].
8. If temporalDurationLike.[[Weeks]] is not undefined, then
a. Let weeks be temporalDurationLike.[[Weeks]].
9. Else,
a. Let weeks be duration.[[Weeks]].
10. If temporalDurationLike.[[Days]] is not undefined, then
a. Let days be temporalDurationLike.[[Days]].
11. Else,
a. Let days be duration.[[Days]].
12. If temporalDurationLike.[[Hours]] is not undefined, then
a. Let hours be temporalDurationLike.[[Hours]].
13. Else,
a. Let hours be duration.[[Hours]].
14. If temporalDurationLike.[[Minutes]] is not undefined, then
a. Let minutes be temporalDurationLike.[[Minutes]].
15. Else,
a. Let minutes be duration.[[Minutes]].
16. If temporalDurationLike.[[Seconds]] is not undefined, then
a. Let seconds be temporalDurationLike.[[Seconds]].
17. Else,
a. Let seconds be duration.[[Seconds]].
18. If temporalDurationLike.[[Milliseconds]] is not undefined, then
a. Let milliseconds be temporalDurationLike.[[Milliseconds]].
19. Else,
a. Let milliseconds be duration.[[Milliseconds]].
20. If temporalDurationLike.[[Microseconds]] is not undefined, then
a. Let microseconds be temporalDurationLike.[[Microseconds]].
21. Else,
a. Let microseconds be duration.[[Microseconds]].
22. If temporalDurationLike.[[Nanoseconds]] is not undefined, then
a. Let nanoseconds be temporalDurationLike.[[Nanoseconds]].
23. Else,
a. Let nanoseconds be duration.[[Nanoseconds]].
24. Return ? CreateTemporalDuration(years, months, weeks, days, hours, minutes, seconds, milliseconds, microseconds, nanoseconds).
features: [Temporal]
includes: [temporalHelpers.js]
--- |
3594 |
- |
| argument-invalid-property.js |
---
esid: sec-temporal.duration.prototype.with
description: temporalDurationLike object must contain at least one correctly spelled property
features: [Temporal]
--- |
1085 |
- |
| argument-mixed-sign.js |
---
esid: sec-temporal.duration.prototype.with
description: Positive and negative values in the temporalDurationLike argument are not acceptable
features: [Temporal]
--- |
635 |
- |
| argument-not-object.js |
---
esid: sec-temporal.duration.prototype.with
description: Passing a primitive to with() throws
features: [Symbol, Temporal]
--- |
1050 |
- |
| argument-singular-properties.js |
---
esid: sec-temporal.duration.prototype.with
description: Singular properties in the property bag are always ignored
features: [Temporal]
--- |
870 |
- |
| blank-duration.js |
---
esid: sec-temporal.duration.prototype.with
description: Behaviour with blank duration
features: [Temporal]
includes: [temporalHelpers.js]
--- |
1865 |
- |
| branding.js |
---
esid: sec-temporal.duration.prototype.with
description: Throw a TypeError if the receiver is invalid
features: [Symbol, Temporal]
--- |
1194 |
- |
| browser.js |
|
0 |
- |
| builtin.js |
---
esid: sec-temporal.duration.prototype.with
description: >
Tests that Temporal.Duration.prototype.with
meets the requirements for built-in objects defined by the
introduction of chapter 17 of the ECMAScript Language Specification.
info: |
Built-in functions that are not constructors do not have a "prototype" property unless
otherwise specified in the description of a particular function.
Unless specified otherwise, a built-in object that is callable as a function is a built-in
function object with the characteristics described in 10.3. Unless specified otherwise, the
[[Extensible]] internal slot of a built-in object initially has the value true.
Unless otherwise specified every built-in function and every built-in constructor has the
Function prototype object [...] as the value of its [[Prototype]] internal slot.
features: [Temporal]
--- |
1629 |
- |
| copy-properties-not-undefined.js |
---
esid: sec-temporal.duration.prototype.with
description: PreparePartialTemporalFields copies only defined properties of source object
info: |
4. For each value _property_ of _fieldNames_, do
a. Let _value_ be ? Get(_fields_, _property_).
b. If _value_ is not *undefined*, then
...
iii. Perform ! CreateDataPropertyOrThrow(_result_, _property_, _value_).
includes: [temporalHelpers.js]
features: [Temporal]
--- |
964 |
- |
| infinity-throws-rangeerror.js |
---
description: Temporal.Duration.prototype.with handles a property bag if any value is Infinity
esid: sec-temporal.duration.prototype.with
features: [Temporal]
--- |
1009 |
- |
| length.js |
---
esid: sec-temporal.duration.prototype.with
description: Temporal.Duration.prototype.with.length is 1
info: |
Every built-in function object, including constructors, has a "length" property whose value is
an integer. Unless otherwise specified, this value is equal to the largest number of named
arguments shown in the subclause headings for the function description. Optional parameters
(which are indicated with brackets: [ ]) or rest parameters (which are shown using the form
«...name») are not included in the default argument count.
Unless otherwise specified, the "length" property of a built-in function object has the
attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }.
includes: [propertyHelper.js]
features: [Temporal]
--- |
1191 |
- |
| name.js |
---
esid: sec-temporal.duration.prototype.with
description: Temporal.Duration.prototype.with.name is "with".
info: |
Every built-in function object, including constructors, that is not identified as an anonymous
function has a "name" property whose value is a String. Unless otherwise specified, this value
is the name that is given to the function in this specification.
Unless otherwise specified, the "name" property of a built-in function object, if it exists,
has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }.
includes: [propertyHelper.js]
features: [Temporal]
--- |
1027 |
- |
| negative-infinity-throws-rangeerror.js |
---
description: Temporal.Duration.prototype.with throws a RangeError if any value in a property bag is -Infinity
esid: sec-temporal.duration.prototype.with
features: [Temporal]
--- |
1027 |
- |
| non-integer-throws-rangeerror.js |
---
esid: sec-temporal.duration.prototype.with
description: A non-integer value for any recognized property in the property bag, throws a RangeError
features: [Temporal]
--- |
826 |
- |
| not-a-constructor.js |
---
esid: sec-temporal.duration.prototype.with
description: >
Temporal.Duration.prototype.with does not implement [[Construct]], is not new-able
info: |
Built-in function objects that are not identified as constructors do not implement the
[[Construct]] internal method unless otherwise specified in the description of a particular
function.
includes: [isConstructor.js]
features: [Reflect.construct, Temporal]
--- |
915 |
- |
| order-of-operations.js |
---
esid: sec-temporal.duration.prototype.with
description: Properties on an object passed to with() are accessed in the correct order
includes: [compareArray.js, temporalHelpers.js]
features: [Temporal]
--- |
1869 |
- |
| partial-positive.js |
---
esid: sec-temporal.duration.prototype.with
description: >
Returns a correctly merged object when the argument replaces only some of the
fields with positive values.
info: |
1. Let duration be the this value.
2. Perform ? RequireInternalSlot(duration, [[InitializedTemporalDuration]]).
3. Let temporalDurationLike be ? ToPartialDuration(temporalDurationLike).
4. If temporalDurationLike.[[Years]] is not undefined, then
a. Let years be temporalDurationLike.[[Years]].
5. Else,
a. Let years be duration.[[Years]].
6. If temporalDurationLike.[[Months]] is not undefined, then
a. Let months be temporalDurationLike.[[Months]].
7. Else,
a. Let months be duration.[[Months]].
8. If temporalDurationLike.[[Weeks]] is not undefined, then
a. Let weeks be temporalDurationLike.[[Weeks]].
9. Else,
a. Let weeks be duration.[[Weeks]].
10. If temporalDurationLike.[[Days]] is not undefined, then
a. Let days be temporalDurationLike.[[Days]].
11. Else,
a. Let days be duration.[[Days]].
12. If temporalDurationLike.[[Hours]] is not undefined, then
a. Let hours be temporalDurationLike.[[Hours]].
13. Else,
a. Let hours be duration.[[Hours]].
14. If temporalDurationLike.[[Minutes]] is not undefined, then
a. Let minutes be temporalDurationLike.[[Minutes]].
15. Else,
a. Let minutes be duration.[[Minutes]].
16. If temporalDurationLike.[[Seconds]] is not undefined, then
a. Let seconds be temporalDurationLike.[[Seconds]].
17. Else,
a. Let seconds be duration.[[Seconds]].
18. If temporalDurationLike.[[Milliseconds]] is not undefined, then
a. Let milliseconds be temporalDurationLike.[[Milliseconds]].
19. Else,
a. Let milliseconds be duration.[[Milliseconds]].
20. If temporalDurationLike.[[Microseconds]] is not undefined, then
a. Let microseconds be temporalDurationLike.[[Microseconds]].
21. Else,
a. Let microseconds be duration.[[Microseconds]].
22. If temporalDurationLike.[[Nanoseconds]] is not undefined, then
a. Let nanoseconds be temporalDurationLike.[[Nanoseconds]].
23. Else,
a. Let nanoseconds be duration.[[Nanoseconds]].
24. Return ? CreateTemporalDuration(years, months, weeks, days, hours, minutes, seconds, milliseconds, microseconds, nanoseconds).
features: [Temporal]
includes: [temporalHelpers.js]
--- |
4381 |
- |
| prop-desc.js |
---
esid: sec-temporal.duration.prototype.with
description: The "with" property of Temporal.Duration.prototype
includes: [propertyHelper.js]
features: [Temporal]
--- |
668 |
- |
| shell.js |
---
description: |
Test if a given function is a constructor function.
defines: [isConstructor]
features: [Reflect.construct]
--- |
596 |
- |
| sign-conflict-throws-rangeerror.js |
---
esid: sec-temporal.duration.prototype.with
description: Throw RangeError if the resulting duration has mixed signs
info: |
24. Return ? CreateTemporalDuration(years, months, weeks, days, hours, minutes, seconds, milliseconds, microseconds, nanoseconds).
features: [Temporal]
--- |
1196 |
- |
| sign-replace.js |
---
esid: sec-temporal.duration.prototype.with
description: Replacing the sign is supported.
includes: [temporalHelpers.js]
features: [Temporal]
--- |
672 |
- |
| subclassing-ignored.js |
---
esid: sec-temporal.duration.prototype.with
description: Objects of a subclass are never created as return values.
includes: [temporalHelpers.js]
features: [Temporal]
--- |
654 |
- |