ambiguous-date.js |
---
esid: sec-temporal.plaindatetime.prototype.add
description: Ambiguous addition is handled according to the overflow option
features: [Temporal]
includes: [temporalHelpers.js]
--- |
1087 |
argument-duration-max.js |
---
esid: sec-temporal.plaindatetime.prototype.add
description: Maximum allowed duration
includes: [temporalHelpers.js]
features: [Temporal]
--- |
3191 |
argument-duration-out-of-range.js |
---
esid: sec-temporal.plaindatetime.prototype.add
description: Duration-like argument that is out of range
features: [Temporal]
--- |
4247 |
argument-duration.js |
---
esid: sec-temporal.plaindatetime.prototype.add
description: Duration object arguments are handled
features: [Temporal]
includes: [temporalHelpers.js]
--- |
699 |
argument-invalid-property.js |
---
esid: sec-temporal.plaindatetime.prototype.add
description: temporalDurationLike object must contain at least one correctly spelled property
features: [Temporal]
--- |
922 |
argument-mixed-sign.js |
---
esid: sec-temporal.plaindatetime.prototype.add
description: Positive and negative values in the temporalDurationLike argument are not acceptable
features: [Temporal]
--- |
824 |
argument-not-object.js |
---
esid: sec-temporal.plaindatetime.prototype.add
description: Passing a primitive other than string to add() throws
features: [Symbol, Temporal]
--- |
1135 |
argument-singular-properties.js |
---
esid: sec-temporal.plaindatetime.prototype.add
description: Singular properties in the property bag are always ignored
features: [Temporal]
--- |
889 |
argument-string-fractional-units-rounding-mode.js |
---
esid: sec-temporal.plaindatetime.prototype.add
description: Strings with fractional duration units are rounded with the correct rounding mode
includes: [temporalHelpers.js]
features: [Temporal]
--- |
932 |
argument-string-negative-fractional-units.js |
---
esid: sec-temporal.plaindatetime.prototype.add
description: Strings with fractional duration units are treated with the correct sign
includes: [temporalHelpers.js]
features: [Temporal]
--- |
948 |
argument-string.js |
---
esid: sec-temporal.plaindatetime.prototype.add
description: A string is parsed into the correct object when passed as the argument
includes: [temporalHelpers.js]
features: [Temporal]
--- |
802 |
balance-negative-time-units.js |
---
esid: sec-temporal.plaindatetime.prototype.add
description: Negative time fields are balanced upwards
info: |
sec-temporal-balancetime steps 3–14:
3. Set _microsecond_ to _microsecond_ + floor(_nanosecond_ / 1000).
4. Set _nanosecond_ to _nanosecond_ modulo 1000.
5. Set _millisecond_ to _millisecond_ + floor(_microsecond_ / 1000).
6. Set _microsecond_ to _microsecond_ modulo 1000.
7. Set _second_ to _second_ + floor(_millisecond_ / 1000).
8. Set _millisecond_ to _millisecond_ modulo 1000.
9. Set _minute_ to _minute_ + floor(_second_ / 60).
10. Set _second_ to _second_ modulo 60.
11. Set _hour_ to _hour_ + floor(_minute_ / 60).
12. Set _minute_ to _minute_ modulo 60.
13. Let _days_ be floor(_hour_ / 24).
14. Set _hour_ to _hour_ modulo 24.
sec-temporal-addtime step 8:
8. Return ? BalanceTime(_hour_, _minute_, _second_, _millisecond_, _microsecond_, _nanosecond_).
sec-temporal-adddatetime step 1:
1. Let _timeResult_ be ? AddTime(_hour_, _minute_, _second_, _millisecond_, _microsecond_, _nanosecond_, _hours_, _minutes_, _seconds_, _milliseconds_, _microseconds_, _nanoseconds_).
sec-temporal.plaindatetime.prototype.add step 5:
5. Let _result_ be ? AddDateTime(_dateTime_.[[ISOYear]], _dateTime_.[[ISOMonth]], _dateTime_.[[ISODay]], _dateTime_.[[ISOHour]], _dateTime_.[[ISOMinute]], _dateTime_.[[ISOSecond]], _dateTime_.[[ISOMillisecond]], _dateTime_.[[ISOMicrosecond]], _dateTime_.[[ISONanosecond]], _dateTime_.[[Calendar]], _duration_.[[Years]], _duration_.[[Months]], _duration_.[[Weeks]], _duration_.[[Days]], _duration_.[[Hours]], _duration_.[[Minutes]], _duration_.[[Seconds]], _duration_.[[Milliseconds]], _duration_.[[Microseconds]], _duration_.[[Nanoseconds]], _options_).
includes: [temporalHelpers.js]
features: [Temporal]
--- |
3364 |
branding.js |
---
esid: sec-temporal.plaindatetime.prototype.add
description: Throw a TypeError if the receiver is invalid
features: [Symbol, Temporal]
--- |
1287 |
browser.js |
|
0 |
builtin.js |
---
esid: sec-temporal.plaindatetime.prototype.add
description: >
Tests that Temporal.PlainDateTime.prototype.add
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]
--- |
1728 |
hour-overflow.js |
---
esid: sec-temporal.plaindatetime.prototype.add
description: Testing overflow hours (adding hours that push one to the next/previous day)
features: [Temporal]
includes: [temporalHelpers.js]
--- |
1010 |
infinity-throws-rangeerror.js |
---
description: Temporal.PlainDateTime.prototype.add throws a RangeError if any value in a property bag is Infinity
esid: sec-temporal.plaindatetime.prototype.add
features: [Temporal]
--- |
1349 |
length.js |
---
esid: sec-temporal.plaindatetime.prototype.add
description: Temporal.PlainDateTime.prototype.add.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]
--- |
1278 |
limits.js |
---
esid: sec-temporal.plaindatetime.prototype.add
description: Checking limits of representable PlainDateTime
features: [Temporal]
--- |
1002 |
name.js |
---
esid: sec-temporal.plaindatetime.prototype.add
description: Temporal.PlainDateTime.prototype.add.name is "add".
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]
--- |
1112 |
negative-duration.js |
---
esid: sec-temporal.plaindatetime.prototype.add
description: Negative durations can be supplied
features: [Temporal]
includes: [temporalHelpers.js]
--- |
816 |
negative-infinity-throws-rangeerror.js |
---
description: Temporal.PlainDateTime.prototype.add throws a RangeError if any value in a property bag is -Infinity
esid: sec-temporal.plaindatetime.prototype.add
features: [Temporal]
--- |
1352 |
non-integer-throws-rangeerror.js |
---
esid: sec-temporal.plaindatetime.prototype.add
description: A non-integer value for any recognized property in the property bag, throws a RangeError
features: [Temporal]
--- |
911 |
not-a-constructor.js |
---
esid: sec-temporal.plaindatetime.prototype.add
description: >
Temporal.PlainDateTime.prototype.add 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]
--- |
1010 |
options-empty.js |
---
esid: sec-temporal.plaindatetime.prototype.add
description: Verify that undefined options are handled correctly.
features: [Temporal]
includes: [temporalHelpers.js]
--- |
864 |
options-invalid.js |
---
esid: sec-temporal.plaindatetime.prototype.add
description: Various invalid (wrong type) values for options argument
features: [Temporal, Symbol]
--- |
759 |
options-undefined.js |
---
esid: sec-temporal.plaindatetime.prototype.add
description: Verify that undefined options are handled correctly.
features: [Temporal]
--- |
960 |
options-wrong-type.js |
---
esid: sec-temporal.plaindatetime.prototype.add
description: TypeError thrown when options argument is a primitive
features: [BigInt, Symbol, Temporal]
--- |
787 |
order-of-operations.js |
---
esid: sec-temporal.plaindatetime.prototype.add
description: Properties on an object passed to add() are accessed in the correct order
includes: [compareArray.js, temporalHelpers.js]
features: [Temporal]
--- |
2238 |
overflow-invalid-string.js |
---
esid: sec-temporal.plaindatetime.prototype.add
description: RangeError thrown when overflow option not one of the allowed string values
info: |
sec-getoption step 10:
10. If _values_ is not *undefined* and _values_ does not contain an element equal to _value_, throw a *RangeError* exception.
sec-temporal-totemporaloverflow step 1:
1. Return ? GetOption(_normalizedOptions_, *"overflow"*, « String », « *"constrain"*, *"reject"* », *"constrain"*).
sec-temporal.calendar.prototype.dateadd step 7:
7. Let _overflow_ be ? ToTemporalOverflow(_options_).
sec-temporal-adddatetime step 4:
4. Let _addedDate_ be ? CalendarDateAdd(_calendar_, _datePart_, _dateDuration_, _options_).
sec-temporal.plaindatetime.prototype.add step 5:
5. Let _result_ be ? AddDateTime(_dateTime_.[[ISOYear]], _dateTime_.[[ISOMonth]], _dateTime_.[[ISODay]], _dateTime_.[[ISOHour]], _dateTime_.[[ISOMinute]], _dateTime_.[[ISOSecond]], _dateTime_.[[ISOMillisecond]], _dateTime_.[[ISOMicrosecond]], _dateTime_.[[ISONanosecond]], _dateTime_.[[Calendar]], _duration_.[[Years]], _duration_.[[Months]], _duration_.[[Weeks]], _duration_.[[Days]], _duration_.[[Hours]], _duration_.[[Minutes]], _duration_.[[Seconds]], _duration_.[[Milliseconds]], _duration_.[[Microseconds]], _duration_.[[Nanoseconds]], _options_).
features: [Temporal]
--- |
2076 |
overflow-undefined.js |
---
esid: sec-temporal.plaindatetime.prototype.add
description: Fallback value for overflow option
info: |
sec-getoption step 3:
3. If _value_ is *undefined*, return _fallback_.
sec-temporal-totemporaloverflow step 1:
1. Return ? GetOption(_normalizedOptions_, *"overflow"*, « String », « *"constrain"*, *"reject"* », *"constrain"*).
sec-temporal.calendar.prototype.dateadd step 7:
7. Let _overflow_ be ? ToTemporalOverflow(_options_).
sec-temporal-adddatetime step 4:
4. Let _addedDate_ be ? CalendarDateAdd(_calendar_, _datePart_, _dateDuration_, _options_).
sec-temporal.plaindatetime.prototype.add step 5:
5. Let _result_ be ? AddDateTime(_dateTime_.[[ISOYear]], _dateTime_.[[ISOMonth]], _dateTime_.[[ISODay]], _dateTime_.[[ISOHour]], _dateTime_.[[ISOMinute]], _dateTime_.[[ISOSecond]], _dateTime_.[[ISOMillisecond]], _dateTime_.[[ISOMicrosecond]], _dateTime_.[[ISONanosecond]], _dateTime_.[[Calendar]], _duration_.[[Years]], _duration_.[[Months]], _duration_.[[Weeks]], _duration_.[[Days]], _duration_.[[Hours]], _duration_.[[Minutes]], _duration_.[[Seconds]], _duration_.[[Milliseconds]], _duration_.[[Microseconds]], _duration_.[[Nanoseconds]], _options_).
includes: [temporalHelpers.js]
features: [Temporal]
--- |
2060 |
overflow-wrong-type.js |
---
esid: sec-temporal.plaindatetime.prototype.add
description: Type conversions for overflow option
info: |
sec-getoption step 9.a:
a. Set _value_ to ? ToString(_value_).
sec-temporal-totemporaloverflow step 1:
1. Return ? GetOption(_normalizedOptions_, *"overflow"*, « String », « *"constrain"*, *"reject"* », *"constrain"*).
sec-temporal.calendar.prototype.dateadd step 7:
7. Let _overflow_ be ? ToTemporalOverflow(_options_).
sec-temporal-adddatetime step 4:
4. Let _addedDate_ be ? CalendarDateAdd(_calendar_, _datePart_, _dateDuration_, _options_).
sec-temporal.plaindatetime.prototype.add step 5:
5. Let _result_ be ? AddDateTime(_dateTime_.[[ISOYear]], _dateTime_.[[ISOMonth]], _dateTime_.[[ISODay]], _dateTime_.[[ISOHour]], _dateTime_.[[ISOMinute]], _dateTime_.[[ISOSecond]], _dateTime_.[[ISOMillisecond]], _dateTime_.[[ISOMicrosecond]], _dateTime_.[[ISONanosecond]], _dateTime_.[[Calendar]], _duration_.[[Years]], _duration_.[[Months]], _duration_.[[Weeks]], _duration_.[[Days]], _duration_.[[Hours]], _duration_.[[Minutes]], _duration_.[[Seconds]], _duration_.[[Milliseconds]], _duration_.[[Microseconds]], _duration_.[[Nanoseconds]], _options_).
includes: [compareArray.js, temporalHelpers.js]
features: [Temporal]
--- |
1965 |
prop-desc.js |
---
esid: sec-temporal.plaindatetime.prototype.add
description: The "add" property of Temporal.PlainDateTime.prototype
includes: [propertyHelper.js]
features: [Temporal]
--- |
763 |
shell.js |
---
description: |
Test if a given function is a constructor function.
defines: [isConstructor]
features: [Reflect.construct]
--- |
596 |
subclassing-ignored.js |
---
esid: sec-temporal.plaindatetime.prototype.add
description: Objects of a subclass are never created as return values for add()
includes: [temporalHelpers.js]
features: [Temporal]
--- |
766 |
throws-if-duration-days-too-large.js |
---
esid: sec-temporal.plaindatetime.prototype.add
description: >
Throws duration days are too large.
info: |
Temporal.PlainDateTime.prototype.add ( temporalDurationLike [ , options ] )
...
3. Return ? AddDurationToDateTime(add, dateTime, temporalDurationLike, options).
AddDurationToDateTime ( operation, dateTime, temporalDurationLike, options )
...
6. Let timeResult be AddTime(dateTime.[[ISODateTime]].[[Time]], internalDuration.[[Time]]).
7. Let dateDuration be ? AdjustDateDurationRecord(internalDuration.[[Date]], timeResult.[[Days]]).
...
features: [Temporal]
--- |
1290 |