| balance-subseconds.js |
---
esid: sec-temporal.duration.prototype.tostring
description: Balancing from subsecond units to seconds happens correctly
features: [Temporal]
--- |
671 |
- |
| balance.js |
---
esid: sec-temporal.duration.prototype.tostring
description: Verify that values are balanced correctly.
features: [Temporal]
--- |
891 |
- |
| blank-duration-precision.js |
---
esid: sec-temporal.duration.prototype.tostring
description: >
Precision is handled correctly for blank durations, whether specified by
fractionalSecondDigits or smallestUnit
features: [Temporal]
--- |
1134 |
- |
| branding.js |
---
esid: sec-temporal.duration.prototype.tostring
description: Throw a TypeError if the receiver is invalid
features: [Symbol, Temporal]
--- |
1142 |
- |
| browser.js |
|
0 |
- |
| builtin.js |
---
esid: sec-temporal.duration.prototype.tostring
description: >
Tests that Temporal.Duration.prototype.toString
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]
--- |
1653 |
- |
| fractionalseconddigits-auto.js |
---
esid: sec-temporal.duration.prototype.tostring
description: auto value for fractionalSecondDigits option
features: [Temporal]
--- |
886 |
- |
| fractionalseconddigits-exact-number-of-digits.js |
---
esid: sec-temporal.duration.prototype.tostring
description: |
The fractionalSecondDigits and smallestUnit options determine the exact number
of digits shown after the decimal separator, no more and no less
info: |
sec-temporaldurationtostring step 21:
21. If any of _seconds_, _milliseconds_, _microseconds_, and _nanoseconds_ are not 0; or _years_, _months_, _weeks_, _days_, _hours_, and _minutes_ are all 0; or _precision_ is not *"auto"*; then
features: [Temporal]
--- |
2232 |
- |
| fractionalseconddigits-invalid-string.js |
---
esid: sec-temporal.duration.prototype.tostring
description: RangeError thrown when fractionalSecondDigits option not one of the allowed string values
info: |
sec-getstringornumberoption step 4:
4. If _stringValues_ is not *undefined* and _stringValues_ does not contain an element equal to _value_, throw a *RangeError* exception.
sec-temporal-tosecondsstringprecision step 9:
9. Let _digits_ be ? GetStringOrNumberOption(_normalizedOptions_, *"fractionalSecondDigits"*, « *"auto"* », 0, 9, *"auto"*).
sec-temporal.duration.prototype.tostring step 4:
4. Let _precision_ be ? ToSecondsStringPrecision(_options_).
features: [Temporal]
--- |
1264 |
- |
| fractionalseconddigits-nan.js |
---
esid: sec-temporal.duration.prototype.tostring
description: RangeError thrown when fractionalSecondDigits option is NaN
info: |
sec-getoption step 8.b:
b. If _value_ is *NaN*, throw a *RangeError* exception.
sec-getstringornumberoption step 2:
2. Let _value_ be ? GetOption(_options_, _property_, « Number, String », *undefined*, _fallback_).
sec-temporal-tosecondsstringprecision step 9:
9. Let _digits_ be ? GetStringOrNumberOption(_normalizedOptions_, *"fractionalSecondDigits"*, « *"auto"* », 0, 9, *"auto"*).
sec-temporal.duration.prototype.tostring step 4:
4. Let _precision_ be ? ToSecondsStringPrecision(_options_).
features: [Temporal]
--- |
1109 |
- |
| fractionalseconddigits-non-integer.js |
---
esid: sec-temporal.duration.prototype.tostring
description: Rounding for fractionalSecondDigits option
info: |
sec-getstringornumberoption step 3.b:
b. Return floor(ℝ(_value_)).
sec-temporal-tosecondsstringprecision step 9:
9. Let _digits_ be ? GetStringOrNumberOption(_normalizedOptions_, *"fractionalSecondDigits"*, « *"auto"* », 0, 9, *"auto"*).
sec-temporal.duration.prototype.tostring step 4:
4. Let _precision_ be ? ToSecondsStringPrecision(_options_).
features: [Temporal]
--- |
1349 |
- |
| fractionalseconddigits-number.js |
---
esid: sec-temporal.duration.prototype.tostring
description: Number for fractionalSecondDigits option
features: [Temporal]
--- |
1584 |
- |
| fractionalseconddigits-out-of-range.js |
---
esid: sec-temporal.duration.prototype.tostring
description: RangeError thrown when fractionalSecondDigits option out of range
info: |
sec-getstringornumberoption step 3.a:
a. If _value_ < _minimum_ or _value_ > _maximum_, throw a *RangeError* exception.
sec-temporal-tosecondsstringprecision step 9:
9. Let _digits_ be ? GetStringOrNumberOption(_normalizedOptions_, *"fractionalSecondDigits"*, « *"auto"* », 0, 9, *"auto"*).
sec-temporal.duration.prototype.tostring step 4:
4. Let _precision_ be ? ToSecondsStringPrecision(_options_).
features: [Temporal]
--- |
1484 |
- |
| fractionalseconddigits-undefined.js |
---
esid: sec-temporal.duration.prototype.tostring
description: Fallback value for fractionalSecondDigits option
info: |
sec-getoption step 3:
3. If _value_ is *undefined*, return _fallback_.
sec-getstringornumberoption step 2:
2. Let _value_ be ? GetOption(_options_, _property_, « Number, String », *undefined*, _fallback_).
sec-temporal-tosecondsstringprecision step 9:
9. Let _digits_ be ? GetStringOrNumberOption(_normalizedOptions_, *"fractionalSecondDigits"*, « *"auto"* », 0, 9, *"auto"*).
sec-temporal.duration.prototype.tostring step 4:
4. Let _precision_ be ? ToSecondsStringPrecision(_options_).
features: [Temporal]
--- |
1722 |
- |
| fractionalseconddigits-wrong-type.js |
---
esid: sec-temporal.duration.prototype.tostring
description: Type conversions for fractionalSecondDigits option
info: |
sec-getoption steps 8–9:
8. Else if _type_ is Number, then
a. Set _value_ to ? ToNumber(value).
b. ...
9. Else,
a. Set _value_ to ? ToString(value).
sec-getstringornumberoption step 2:
2. Let _value_ be ? GetOption(_options_, _property_, « Number, String », *undefined*, _fallback_).
sec-temporal-tosecondsstringprecision step 9:
9. Let _digits_ be ? GetStringOrNumberOption(_normalizedOptions_, *"fractionalSecondDigits"*, « *"auto"* », 0, 9, *"auto"*).
sec-temporal.duration.prototype.tostring step 4:
4. Let _precision_ be ? ToSecondsStringPrecision(_options_).
includes: [compareArray.js, temporalHelpers.js]
features: [Temporal]
--- |
2754 |
- |
| large-with-small-units.js |
---
esid: sec-temporal.duration.prototype.tostring
description: Pairs of units with one large and one small
features: [Temporal]
--- |
1005 |
- |
| length.js |
---
esid: sec-temporal.duration.prototype.tostring
description: Temporal.Duration.prototype.toString.length is 0
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]
--- |
1203 |
- |
| max-value.js |
---
esid: sec-temporal.duration.prototype.tostring
description: Balancing the maximum nanoseconds and seconds does not go out of range
features: [Temporal]
--- |
911 |
- |
| name.js |
---
esid: sec-temporal.duration.prototype.tostring
description: Temporal.Duration.prototype.toString.name is "toString".
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]
--- |
1047 |
- |
| negative-components.js |
---
esid: sec-temporal.duration.prototype.tostring
description: Temporal.Duration.toString handles negative components
features: [Temporal]
--- |
1426 |
- |
| no-precision-loss.js |
---
esid: sec-temporal.duration.prototype.tostring
description: Serializing balance doesn't lose precision when values are precise.
features: [Temporal]
--- |
642 |
- |
| not-a-constructor.js |
---
esid: sec-temporal.duration.prototype.tostring
description: >
Temporal.Duration.prototype.toString 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]
--- |
935 |
- |
| options-object.js |
---
esid: sec-temporal.duration.prototype.tostring
description: Empty or a function object may be used as options
features: [Temporal]
--- |
691 |
- |
| options-read-before-algorithmic-validation.js |
---
esid: sec-temporal.duration.prototype.tostring
description: >
All options properties are read and cast before any algorithmic validation
includes: [compareArray.js, temporalHelpers.js]
features: [Temporal]
--- |
1333 |
- |
| options-undefined.js |
---
esid: sec-temporal.duration.prototype.tostring
description: Verify that undefined options are handled correctly.
features: [Temporal]
--- |
917 |
- |
| options-wrong-type.js |
---
esid: sec-temporal.duration.prototype.tostring
description: TypeError thrown when options argument is a primitive
features: [BigInt, Symbol, Temporal]
--- |
700 |
- |
| order-of-operations.js |
---
esid: sec-temporal.duration.prototype.tostring
description: Properties on objects passed to toString() are accessed in the correct order
includes: [compareArray.js, temporalHelpers.js]
features: [Temporal]
--- |
1559 |
- |
| precision.js |
---
esid: sec-temporal.duration.prototype.tostring
description: toString() produces a fractional part of the correct length
features: [Temporal]
--- |
705 |
- |
| prop-desc.js |
---
esid: sec-temporal.duration.prototype.tostring
description: The "toString" property of Temporal.Duration.prototype
includes: [propertyHelper.js]
features: [Temporal]
--- |
688 |
- |
| round-cross-unit-boundary.js |
---
esid: sec-temporal.duration.prototype.tostring
description: Rounding can cross unit boundaries up to days
features: [Temporal]
--- |
1674 |
- |
| roundingmode-ceil.js |
---
esid: sec-temporal.duration.prototype.tostring
description: ceil value for roundingMode option
features: [Temporal]
--- |
1682 |
- |
| roundingmode-floor.js |
---
esid: sec-temporal.duration.prototype.tostring
description: floor value for roundingMode option
features: [Temporal]
--- |
1695 |
- |
| roundingmode-halfExpand.js |
---
esid: sec-temporal.duration.prototype.tostring
description: halfExpand value for roundingMode option
features: [Temporal]
--- |
1760 |
- |
| roundingmode-invalid-string.js |
---
esid: sec-temporal.duration.prototype.tostring
description: RangeError thrown when roundingMode option not one of the allowed string values
features: [Temporal]
--- |
713 |
- |
| roundingmode-trunc.js |
---
esid: sec-temporal.duration.prototype.tostring
description: trunc value for roundingMode option
features: [Temporal]
--- |
1695 |
- |
| roundingmode-undefined.js |
---
esid: sec-temporal.duration.prototype.tostring
description: Fallback value for roundingMode option
features: [Temporal]
--- |
1432 |
- |
| roundingmode-wrong-type.js |
---
esid: sec-temporal.duration.prototype.tostring
description: Type conversions for roundingMode option
includes: [compareArray.js, temporalHelpers.js]
features: [Temporal]
--- |
743 |
- |
| shell.js |
---
description: |
Test if a given function is a constructor function.
defines: [isConstructor]
features: [Reflect.construct]
--- |
596 |
- |
| smallestunit-fractionalseconddigits.js |
---
esid: sec-temporal.duration.prototype.tostring
description: fractionalSecondDigits option is not used with smallestUnit present
features: [Temporal]
--- |
1114 |
- |
| smallestunit-invalid-string.js |
---
esid: sec-temporal.duration.prototype.tostring
description: RangeError thrown when smallestUnit option not one of the allowed string values
features: [Temporal]
--- |
1005 |
- |
| smallestunit-plurals-accepted.js |
---
esid: sec-temporal.duration.prototype.tostring
description: Plural units are accepted as well for the smallestUnit option
includes: [temporalHelpers.js]
features: [Temporal]
--- |
706 |
- |
| smallestunit-undefined.js |
---
esid: sec-temporal.duration.prototype.tostring
description: Fallback value for smallestUnit option
features: [Temporal]
--- |
1210 |
- |
| smallestunit-valid-units.js |
---
esid: sec-temporal.duration.prototype.tostring
description: Valid units for the smallestUnit option
features: [Temporal]
--- |
1510 |
- |
| smallestunit-wrong-type.js |
---
esid: sec-temporal.duration.prototype.tostring
description: Type conversions for smallestUnit option
includes: [compareArray.js, temporalHelpers.js]
features: [Temporal]
--- |
720 |
- |
| throws-when-rounded-duration-is-invalid.js |
---
esid: sec-temporal.duration.prototype.tostring
description: >
RoundDuration throws when the rounded duration can't be represented using
float64-representable integers.
info: |
Temporal.Duration.prototype.toString ( [ options ] )
...
7. Let result be (? RoundDuration(...)).[[DurationRecord]].
...
RoundDuration ( years, months, weeks, days, hours, minutes, seconds, milliseconds, microseconds,
nanoseconds, increment, unit, roundingMode [ , relativeTo ] )
...
15. Else if unit is "second", then
a. Set seconds to RoundNumberToIncrement(fractionalSeconds, increment, roundingMode).
b. Set remainder to fractionalSeconds - seconds.
c. Set milliseconds, microseconds, and nanoseconds to 0.
...
19. Let duration be ? CreateDurationRecord(years, months, weeks, days, hours, minutes, seconds,
milliseconds, microseconds, nanoseconds).
...
CreateDurationRecord ( years, months, weeks, days, hours, minutes, seconds, milliseconds,
microseconds, nanoseconds )
1. If ! IsValidDuration(years, months, weeks, days, hours, minutes, seconds, milliseconds,
microseconds, nanoseconds) is false, throw a RangeError exception.
...
features: [Temporal]
--- |
1786 |
- |
| total-of-duration-time-units-out-of-range.js |
---
esid: sec-temporal.duration.prototype.tostring
description: Throws when rounding and total of duration time units is out of range.
features: [Temporal]
--- |
634 |
- |