@@ -94,41 +94,6 @@ <h1>GetStringOrNumberOption ( _options_, _property_, _stringValues_, _minimum_,
94
94
</emu-alg >
95
95
</emu-clause >
96
96
97
- <emu-clause id =" sec-temporal-durationhandlefractions" aoid =" DurationHandleFractions" >
98
- <h1 >DurationHandleFractions ( _fHours_ , _minutes_ , _fMinutes_ , _seconds_ , _milliseconds_ , _microseconds_ , _nanoseconds_ )</h1 >
99
- <emu-alg >
100
- 1. Assert: _fHours_ , _minutes_ , _fMinutes_ , _seconds_ , _milliseconds_ , _microseconds_ , and _nanoseconds_ are integers.
101
- 1. If _fHours_ is not equal to 0, then
102
- 1. If any of _minutes_ , _fMinutes_ , _seconds_ , _milliseconds_ , _microseconds_ , _nanoseconds_ is not 0, throw a *RangeError* exception.
103
- 1. Let _mins_ be _fHours_ × 60.
104
- 1. Set _minutes_ to floor(_mins_ ).
105
- 1. Set _fMinutes_ to remainder(_mins_ , 1).
106
- 1. If _fMinutes_ is not equal to 0, then
107
- 1. If any of _seconds_ , _milliseconds_ , _microseconds_ , _nanoseconds_ is not 0, throw a *RangeError* exception.
108
- 1. Let _secs_ be _fMinutes_ × 60.
109
- 1. Set _seconds_ to floor(_secs_ ).
110
- 1. Let _fSeconds_ be remainder(_secs_ , 1).
111
- 1. If _fSeconds_ is not equal to 0, then
112
- 1. Let _mils_ be _fSeconds_ × 1000.
113
- 1. Set _milliseconds_ to floor(_mils_ ).
114
- 1. Let _fMilliseconds_ be remainder(_mils_ , 1).
115
- 1. If _fMilliseconds_ is not equal to 0, then
116
- 1. Let _mics_ be _fMilliseconds_ × 1000.
117
- 1. Set _microseconds_ to floor(_mics_ ).
118
- 1. Let _fMicroseconds_ be remainder(_mics_ , 1).
119
- 1. If _fMicroseconds_ is not equal to 0, then
120
- 1. Let _nans_ be _fMicroseconds_ × 1000.
121
- 1. Set _nanoseconds_ to floor(_nans_ ).
122
- 1. Return {
123
- [[Minutes]]: _minutes_ ,
124
- [[Seconds]]: _seconds_ ,
125
- [[Milliseconds]]: _milliseconds_ ,
126
- [[Microseconds]]: _microseconds_ ,
127
- [[Nanoseconds]]: _nanoseconds_
128
- }.
129
- </emu-alg >
130
- </emu-clause >
131
-
132
97
<emu-clause id =" sec-temporal-totemporaloverflow" aoid =" ToTemporalOverflow" >
133
98
<h1 >ToTemporalOverflow ( _normalizedOptions_ )</h1 >
134
99
<emu-alg >
@@ -1277,50 +1242,46 @@ <h1>ParseTemporalDurationString ( _isoString_ )</h1>
1277
1242
1. Let _factor_ be −1.
1278
1243
1. Else,
1279
1244
1. Let _factor_ be 1.
1280
- 1. Let _yearsMV_ be ! ToIntegerOrInfinity(CodePointsToString(_years_ )) × _factor_ .
1281
- 1. Let _monthsMV_ be ! ToIntegerOrInfinity(CodePointsToString(_months_ )) × _factor_ .
1282
- 1. Let _weeksMV_ be ! ToIntegerOrInfinity(CodePointsToString(_weeks_ )) × _factor_ .
1283
- 1. Let _daysMV_ be ! ToIntegerOrInfinity(CodePointsToString(_days_ )) × _factor_ .
1284
- 1. Let _hoursMV_ be ! ToIntegerOrInfinity(CodePointsToString(_hours_ )) × _factor_ .
1285
- 1. Let _minutesMV_ be ! ToIntegerOrInfinity(CodePointsToString(_minutes_ )) × _factor_ .
1286
- 1. Let _secondsMV_ be ! ToIntegerOrInfinity(CodePointsToString(_seconds_ )) × _factor_ .
1287
- 1. If _fSeconds_ is not empty, then
1288
- 1. Let _fSecondsDigits_ be the substring of ! CodePointsToString(_fSeconds_ ) from 1.
1289
- 1. Let _fSecondsDigitsExtended_ be the string-concatenation of _fSecondsDigits_ and *"000000000"* .
1290
- 1. Let _milliseconds_ be the substring of _fSecondsDigitsExtended_ from 0 to 3.
1291
- 1. Let _millisecondsMV_ be ! ToIntegerOrInfinity(_milliseconds_ ) × _factor_ .
1292
- 1. Let _microseconds_ be the substring of _fSecondsDigitsExtended_ from 3 to 6.
1293
- 1. Let _microsecondsMV_ be ! ToIntegerOrInfinity(_microseconds_ ) × _factor_ .
1294
- 1. Let _nanoseconds_ be the substring of _fSecondsDigitsExtended_ from 6 to 9.
1295
- 1. Let _nanosecondsMV_ be ! ToIntegerOrInfinity(_nanoseconds_ ) × _factor_ .
1296
- 1. Else,
1297
- 1. Let _millisecondsMV_ be 0.
1298
- 1. Let _microsecondsMV_ be 0.
1299
- 1. Let _nanosecondsMV_ be 0.
1245
+ 1. Let _yearsMV_ be ! ToIntegerOrInfinity(CodePointsToString(_years_ )).
1246
+ 1. Let _monthsMV_ be ! ToIntegerOrInfinity(CodePointsToString(_months_ )).
1247
+ 1. Let _weeksMV_ be ! ToIntegerOrInfinity(CodePointsToString(_weeks_ )).
1248
+ 1. Let _daysMV_ be ! ToIntegerOrInfinity(CodePointsToString(_days_ )).
1249
+ 1. Let _hoursMV_ be ! ToIntegerOrInfinity(CodePointsToString(_hours_ )).
1300
1250
1. If _fHours_ is not empty, then
1251
+ 1. If any of _minutes_ , _fMinutes_ , _seconds_ , _fSeconds_ is not empty, throw a *RangeError* exception.
1301
1252
1. Let _fHoursDigits_ be the substring of ! CodePointsToString(_fHours_ ) from 1.
1302
1253
1. Let _fHoursScale_ be the length of _fHoursDigits_ .
1303
- 1. Let _fHoursMV_ be ! ToIntegerOrInfinity(_fHoursDigits_ ) × _factor_ / 10<sup >_fHoursScale_ </sup >.
1254
+ 1. Let _minutesMV_ be ! ToIntegerOrInfinity(_fHoursDigits_ ) / 10<sup >_fHoursScale_ </sup > × 60 .
1304
1255
1. Else,
1305
- 1. Let _fHoursMV_ be 0 .
1256
+ 1. Let _minutesMV_ be ! ToIntegerOrInfinity(CodePointsToString( _minutes_ )) .
1306
1257
1. If _fMinutes_ is not empty, then
1258
+ 1. If any of _seconds_ , _fSeconds_ is not empty, throw a *RangeError* exception.
1307
1259
1. Let _fMinutesDigits_ be the substring of ! CodePointsToString(_fMinutes_ ) from 1.
1308
1260
1. Let _fMinutesScale_ be the length of _fMinutesDigits_ .
1309
- 1. Let _fMinutesMV_ be ! ToIntegerOrInfinity(_fMinutesDigits_ ) × _factor_ / 10<sup >_fMinutesScale_ </sup >.
1261
+ 1. Let _secondsMV_ be ! ToIntegerOrInfinity(_fMinutesDigits_ ) / 10<sup >_fMinutesScale_ </sup > × 60.
1262
+ 1. Else if _seconds_ is not empty, then
1263
+ 1. Let _secondsMV_ be ! ToIntegerOrInfinity(CodePointsToString(_seconds_ )).
1264
+ 1. Else,
1265
+ 1. Let _secondsMV_ be remainder(_minutesMV_ , 1) × 60.
1266
+ 1. If _fSeconds_ is not empty, then
1267
+ 1. Let _fSecondsDigits_ be the substring of ! CodePointsToString(_fSeconds_ ) from 1.
1268
+ 1. Let _fSecondsScale_ be the length of _fSecondsDigits_ .
1269
+ 1. Let _millisecondsMV_ be ! ToIntegerOrInfinity(_fSecondsDigits_ ) / 10<sup >_fSecondsScale_ </sup > × 1000.
1310
1270
1. Else,
1311
- 1. Let _fMinutesMV_ be 0.
1312
- 1. Let _result_ be ? DurationHandleFractions(_fHoursMV_ , _minutesMV_ , _fMinutesMV_ , _secondsMV_ , _millisecondsMV_ , _microsecondsMV_ , _nanosecondsMV_ ).
1271
+ 1. Let _millisecondsMV_ be remainder(_secondsMV_ , 1) × 1000.
1272
+ 1. Let _microsecondsMV_ be remainder(_millisecondsMV_ , 1) × 1000.
1273
+ 1. Let _nanosecondsMV_ be remainder(_microsecondsMV_ , 1) × 1000.
1313
1274
1. Return the Record {
1314
- [[Years]]: _yearsMV_ ,
1315
- [[Months]]: _monthsMV_ ,
1316
- [[Weeks]]: _weeksMV_ ,
1317
- [[Days]]: _daysMV_ ,
1318
- [[Hours]]: _hoursMV_ ,
1319
- [[Minutes]]: _result_ .[[Minutes]] ,
1320
- [[Seconds]]: _result_ .[[Seconds]] ,
1321
- [[Milliseconds]]: _result_ .[[Milliseconds]] ,
1322
- [[Microseconds]]: _result_ .[[Microseconds]] ,
1323
- [[Nanoseconds]]: _result_ .[[Nanoseconds]]
1275
+ [[Years]]: _yearsMV_ × _factor_ ,
1276
+ [[Months]]: _monthsMV_ × _factor_ ,
1277
+ [[Weeks]]: _weeksMV_ × _factor_ ,
1278
+ [[Days]]: _daysMV_ × _factor_ ,
1279
+ [[Hours]]: _hoursMV_ × _factor_ ,
1280
+ [[Minutes]]: floor( _minutesMV_ ) × _factor_ ,
1281
+ [[Seconds]]: floor( _secondsMV_ ) × _factor_ ,
1282
+ [[Milliseconds]]: floor( _millisecondsMV_ ) × _factor_ ,
1283
+ [[Microseconds]]: floor( _microsecondsMV_ ) × _factor_ ,
1284
+ [[Nanoseconds]]: floor( _nanosecondsMV_ ) × _factor_
1324
1285
}.
1325
1286
</emu-alg >
1326
1287
</emu-clause >
0 commit comments