Skip to content

Commit 943018f

Browse files
FrankYFTangptomato
authored andcommitted
Throw TypeError in Instant.round if options is und
Make the Instant.prototype.round() throw also TypeError instead of RangeError if options is undefined.
1 parent 777cd13 commit 943018f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

spec/instant.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,8 @@ <h1>Temporal.Instant.prototype.round ( _options_ )</h1>
304304
<emu-alg>
305305
1. Let _instant_ be the *this* value.
306306
1. Perform ? RequireInternalSlot(_instant_, [[InitializedTemporalInstant]]).
307+
1. If _options_ is *undefined*, then
308+
1. Throw a *TypeError* exception.
307309
1. Set _options_ to ? GetOptionsObject(_options_).
308310
1. Let _smallestUnit_ be ? ToSmallestTemporalUnit(_options_, « *"year"*, *"month"*, *"week"*, *"day"* », *undefined*).
309311
1. If _smallestUnit_ is *undefined*, throw a *RangeError* exception.

0 commit comments

Comments
 (0)