Skip to content

Commit c3f10a0

Browse files
committed
Rename RejectInstantRange → ValidateEpochNanoseconds
We are going to rename all the ValidateFoo operations in the spec text to IsValidFoo, and remove the RejectFoo operations. This doesn't apply to the polyfill because the form where throwing the exception is part of the operation is more convenient in code. But, still rename RejectInstantRange to ValidateEpochNanoseconds because we are making the same Instant → EpochNanoseconds change to IsValidEpochNanoseconds, because that is what is actually passed to the function.
1 parent 73c20d5 commit c3f10a0

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

lib/ecmascript.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1703,7 +1703,7 @@ export const ES = ObjectAssign({}, ES2020, {
17031703
return result;
17041704
},
17051705
CreateTemporalZonedDateTimeSlots: (result, epochNanoseconds, timeZone, calendar) => {
1706-
ES.RejectInstantRange(epochNanoseconds);
1706+
ES.ValidateEpochNanoseconds(epochNanoseconds);
17071707

17081708
CreateSlots(result);
17091709
SetSlot(result, EPOCHNANOSECONDS, epochNanoseconds);
@@ -3115,7 +3115,7 @@ export const ES = ObjectAssign({}, ES2020, {
31153115
throw new RangeError('DateTime outside of supported range');
31163116
}
31173117
},
3118-
RejectInstantRange: (epochNanoseconds) => {
3118+
ValidateEpochNanoseconds: (epochNanoseconds) => {
31193119
if (epochNanoseconds.lesser(NS_MIN) || epochNanoseconds.greater(NS_MAX)) {
31203120
throw new RangeError('Instant outside of supported range');
31213121
}
@@ -3658,7 +3658,7 @@ export const ES = ObjectAssign({}, ES2020, {
36583658
sum = sum.plus(bigInt(h).multiply(60 * 60 * 1e9));
36593659

36603660
const result = bigInt(epochNanoseconds).plus(sum);
3661-
ES.RejectInstantRange(result);
3661+
ES.ValidateEpochNanoseconds(result);
36623662
return result;
36633663
},
36643664
AddDateTime: (

lib/instant.mjs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export class Instant {
1616
}
1717

1818
const ns = ES.ToBigInt(epochNanoseconds);
19-
ES.RejectInstantRange(ns);
19+
ES.ValidateEpochNanoseconds(ns);
2020
CreateSlots(this);
2121
SetSlot(this, EPOCHNANOSECONDS, ns);
2222

@@ -261,24 +261,24 @@ export class Instant {
261261
static fromEpochSeconds(epochSeconds) {
262262
epochSeconds = ES.ToNumber(epochSeconds);
263263
const epochNanoseconds = bigInt(epochSeconds).multiply(1e9);
264-
ES.RejectInstantRange(epochNanoseconds);
264+
ES.ValidateEpochNanoseconds(epochNanoseconds);
265265
return new Instant(epochNanoseconds);
266266
}
267267
static fromEpochMilliseconds(epochMilliseconds) {
268268
epochMilliseconds = ES.ToNumber(epochMilliseconds);
269269
const epochNanoseconds = bigInt(epochMilliseconds).multiply(1e6);
270-
ES.RejectInstantRange(epochNanoseconds);
270+
ES.ValidateEpochNanoseconds(epochNanoseconds);
271271
return new Instant(epochNanoseconds);
272272
}
273273
static fromEpochMicroseconds(epochMicroseconds) {
274274
epochMicroseconds = ES.ToBigInt(epochMicroseconds);
275275
const epochNanoseconds = epochMicroseconds.multiply(1e3);
276-
ES.RejectInstantRange(epochNanoseconds);
276+
ES.ValidateEpochNanoseconds(epochNanoseconds);
277277
return new Instant(epochNanoseconds);
278278
}
279279
static fromEpochNanoseconds(epochNanoseconds) {
280280
epochNanoseconds = ES.ToBigInt(epochNanoseconds);
281-
ES.RejectInstantRange(epochNanoseconds);
281+
ES.ValidateEpochNanoseconds(epochNanoseconds);
282282
return new Instant(epochNanoseconds);
283283
}
284284
static from(item) {

0 commit comments

Comments
 (0)