Rename all uses of Temporal.now to Temporal.Now (#3069)

See: https://github.com/tc39/proposal-temporal/commit/d0acb66
This commit is contained in:
Linus Groh 2021-07-20 20:06:31 +01:00 committed by GitHub
parent 80678e0bed
commit 0efd2a3baa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
42 changed files with 71 additions and 71 deletions

View File

@ -2,8 +2,8 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.now.instant
description: Temporal.now.instant is extensible.
description: Temporal.Now.instant is extensible.
features: [Temporal]
---*/
assert(Object.isExtensible(Temporal.now.instant));
assert(Object.isExtensible(Temporal.Now.instant));

View File

@ -2,12 +2,12 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.now.instant
description: Temporal.now.instant.length is 0
description: Temporal.Now.instant.length is 0
includes: [propertyHelper.js]
features: [Temporal]
---*/
verifyProperty(Temporal.now.instant, "length", {
verifyProperty(Temporal.Now.instant, "length", {
value: 0,
writable: false,
enumerable: false,

View File

@ -2,14 +2,14 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.now.instant
description: Temporal.now.instant.name is "instant".
description: Temporal.Now.instant.name is "instant".
includes: [propertyHelper.js]
features: [Temporal]
---*/
assert.sameValue(Temporal.now.instant.name, 'instant');
assert.sameValue(Temporal.Now.instant.name, 'instant');
verifyProperty(Temporal.now.instant, 'name', {
verifyProperty(Temporal.Now.instant, 'name', {
enumerable: false,
writable: false,
configurable: true

View File

@ -2,13 +2,13 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.now.instant
description: Temporal.now.instant does not implement [[Construct]]
description: Temporal.Now.instant does not implement [[Construct]]
includes: [isConstructor.js]
features: [Reflect.construct, Temporal]
---*/
assert.sameValue(isConstructor(Temporal.now.instant), false, 'isConstructor(Temporal.now.instant) must return false');
assert.sameValue(isConstructor(Temporal.Now.instant), false, 'isConstructor(Temporal.Now.instant) must return false');
assert.throws(TypeError, () => {
new Temporal.now.instant();
}, '`new Temporal.now.instant()` throws TypeError');
new Temporal.Now.instant();
}, '`new Temporal.Now.instant()` throws TypeError');

View File

@ -2,12 +2,12 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.now.instant
description: The "instant" property of Temporal.now
description: The "instant" property of Temporal.Now
includes: [propertyHelper.js]
features: [Temporal]
---*/
verifyProperty(Temporal.now, 'instant', {
verifyProperty(Temporal.Now, 'instant', {
enumerable: false,
writable: true,
configurable: true

View File

@ -6,7 +6,7 @@ description: Each invocation of the function produces a distinct object value
features: [Temporal]
---*/
var instant1 = Temporal.now.instant();
var instant2 = Temporal.now.instant();
var instant1 = Temporal.Now.instant();
var instant2 = Temporal.Now.instant();
assert.notSameValue(instant1, instant2);

View File

@ -2,11 +2,11 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.now.instant
description: Temporal.now.instant returns an instance of the Instant constructor
description: Temporal.Now.instant returns an instance of the Instant constructor
features: [Temporal]
---*/
assert.sameValue(
Object.getPrototypeOf(Temporal.now.instant()),
Object.getPrototypeOf(Temporal.Now.instant()),
Temporal.Instant.prototype
);

View File

@ -3,13 +3,13 @@
/*---
esid: sec-temporal.now.instant
description: >
Temporal.now.instant returns an Instant describing the current moment in time
Temporal.Now.instant returns an Instant describing the current moment in time
(as corroborated by `Date.now`)
features: [Temporal, BigInt]
---*/
var nowBefore = Date.now();
var seconds = Number(Temporal.now.instant().epochNanoseconds / 1000000n);
var seconds = Number(Temporal.Now.instant().epochNanoseconds / 1000000n);
var nowAfter = Date.now();
assert(seconds >= nowBefore, 'before');

View File

@ -38,7 +38,7 @@ Object.defineProperty(Temporal.Calendar, "from", {
},
});
const result = Temporal.now.plainDateTime(calendar, timeZone);
const result = Temporal.Now.plainDateTime(calendar, timeZone);
for (const property of ["hour", "minute", "second", "millisecond", "microsecond", "nanosecond"]) {
assert.sameValue(result[property], 0, property);
}

View File

@ -16,5 +16,5 @@ var calendar = {
};
assert.throws(Test262Error, function() {
Temporal.now.plainDateTime(calendar);
Temporal.Now.plainDateTime(calendar);
});

View File

@ -13,5 +13,5 @@ var calendar = {
};
assert.throws(Test262Error, function() {
Temporal.now.plainDateTime(calendar);
Temporal.Now.plainDateTime(calendar);
});

View File

@ -16,5 +16,5 @@ var calendar = new Proxy({}, {
});
assert.throws(Test262Error, function() {
Temporal.now.plainDateTime(calendar);
Temporal.Now.plainDateTime(calendar);
});

View File

@ -17,5 +17,5 @@ var calendar = {
};
assert.throws(Test262Error, function() {
Temporal.now.plainDateTime(calendar);
Temporal.Now.plainDateTime(calendar);
});

View File

@ -56,6 +56,6 @@ Object.defineProperty(Temporal.Calendar, 'from', {
},
});
Temporal.now.plainDateTime(calendar);
Temporal.Now.plainDateTime(calendar);
assert.compareArray(actual, expected);

View File

@ -17,6 +17,6 @@ features: [Temporal]
---*/
TemporalHelpers.checkToTemporalCalendarFastPath((temporalObject, calendar) => {
const result = Temporal.now.plainDateTime(temporalObject);
const result = Temporal.Now.plainDateTime(temporalObject);
assert.sameValue(result.calendar, calendar, "Temporal object coerced to calendar");
});

View File

@ -2,8 +2,8 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.now.plaindatetime
description: Temporal.now.plainDateTime is extensible.
description: Temporal.Now.plainDateTime is extensible.
features: [Temporal]
---*/
assert(Object.isExtensible(Temporal.now.plainDateTime));
assert(Object.isExtensible(Temporal.Now.plainDateTime));

View File

@ -3,7 +3,7 @@
/*---
esid: sec-temporal.now.plaindatetime
description: The `length` property of Temporal.now.plainDateTime
description: The `length` property of Temporal.Now.plainDateTime
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
@ -17,7 +17,7 @@ includes: [propertyHelper.js]
features: [Temporal]
---*/
verifyProperty(Temporal.now.plainDateTime, "length", {
verifyProperty(Temporal.Now.plainDateTime, "length", {
value: 1,
writable: false,
enumerable: false,

View File

@ -2,14 +2,14 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.now.plainDateTime
description: Temporal.now.plainDateTime.name is "plainDateTime".
description: Temporal.Now.plainDateTime.name is "plainDateTime".
includes: [propertyHelper.js]
features: [Temporal]
---*/
assert.sameValue(Temporal.now.plainDateTime.name, 'plainDateTime');
assert.sameValue(Temporal.Now.plainDateTime.name, 'plainDateTime');
verifyProperty(Temporal.now.plainDateTime, 'name', {
verifyProperty(Temporal.Now.plainDateTime, 'name', {
enumerable: false,
writable: false,
configurable: true

View File

@ -2,13 +2,13 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.now.plaindatetime
description: Temporal.now.plainDateTime does not implement [[Construct]]
description: Temporal.Now.plainDateTime does not implement [[Construct]]
includes: [isConstructor.js]
features: [Reflect.construct, Temporal]
---*/
assert.sameValue(isConstructor(Temporal.now.plainDateTime), false, 'isConstructor(Temporal.now.plainDateTime) must return false');
assert.sameValue(isConstructor(Temporal.Now.plainDateTime), false, 'isConstructor(Temporal.Now.plainDateTime) must return false');
assert.throws(TypeError, () => {
new Temporal.now.plainDateTime();
}, '`new Temporal.now.plainDateTime()` throws TypeError');
new Temporal.Now.plainDateTime();
}, '`new Temporal.Now.plainDateTime()` throws TypeError');

View File

@ -2,12 +2,12 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-temporal.now.plaindatetime
description: The "plainDateTime" property of Temporal.now
description: The "plainDateTime" property of Temporal.Now
includes: [propertyHelper.js]
features: [Temporal]
---*/
verifyProperty(Temporal.now, 'plainDateTime', {
verifyProperty(Temporal.Now, 'plainDateTime', {
enumerable: false,
writable: true,
configurable: true

View File

@ -14,7 +14,7 @@ const timeZone = {
}
};
const result = Temporal.now.plainDateTime(calendar, timeZone);
const result = Temporal.Now.plainDateTime(calendar, timeZone);
for (const property of ["hour", "minute", "second", "millisecond", "microsecond", "nanosecond"]) {
assert.sameValue(result[property], 0, property);
}

View File

@ -18,12 +18,12 @@ Object.defineProperty(Temporal.TimeZone, "from", {
},
});
const resultExplicit = Temporal.now.plainDateTime("iso8601", undefined);
const resultExplicit = Temporal.Now.plainDateTime("iso8601", undefined);
assert(resultExplicit instanceof Temporal.PlainDateTime);
assert.compareArray(actual, expected, "Temporal.TimeZone.from should not be called");
const resultImplicit = Temporal.now.plainDateTime("iso8601");
const resultImplicit = Temporal.Now.plainDateTime("iso8601");
assert(resultImplicit instanceof Temporal.PlainDateTime);
assert.compareArray(actual, expected, "Temporal.TimeZone.from should not be called");

View File

@ -17,7 +17,7 @@ var timeZone = {
},
};
Temporal.now.plainDateTime('iso8601', timeZone);
Temporal.Now.plainDateTime('iso8601', timeZone);
assert.sameValue(calls.length, 1, 'call count');
assert.sameValue(calls[0].args.length, 1, 'arguments');

View File

@ -11,5 +11,5 @@ includes: [temporalHelpers.js]
[3600_000_000_000.5, NaN].forEach((wrongOffset) => {
const timeZone = TemporalHelpers.specificOffsetTimeZone(wrongOffset);
assert.throws(RangeError, () => Temporal.now.plainDateTime("iso8601", timeZone));
assert.throws(RangeError, () => Temporal.Now.plainDateTime("iso8601", timeZone));
});

View File

@ -11,5 +11,5 @@ var timeZone = {
};
assert.throws(TypeError, function() {
Temporal.now.plainDateTime('iso8601', timeZone);
Temporal.Now.plainDateTime('iso8601', timeZone);
});

View File

@ -28,6 +28,6 @@ for (const dateTime of invalidValues) {
},
};
assert.throws(TypeError, () => Temporal.now.plainDateTime("iso8601", timeZone));
assert.throws(TypeError, () => Temporal.Now.plainDateTime("iso8601", timeZone));
assert.sameValue(callCount, 1, 'Invoked `getOffsetNanosecondsFor`');
}

View File

@ -11,5 +11,5 @@ includes: [temporalHelpers.js]
[-86400_000_000_001, 86400_000_000_001, -Infinity, Infinity].forEach((wrongOffset) => {
const timeZone = TemporalHelpers.specificOffsetTimeZone(wrongOffset);
assert.throws(RangeError, () => Temporal.now.plainDateTime("iso8601", timeZone));
assert.throws(RangeError, () => Temporal.Now.plainDateTime("iso8601", timeZone));
});

View File

@ -13,5 +13,5 @@ var timeZone = {
};
assert.throws(Test262Error, function() {
Temporal.now.plainDateTime('iso8601', timeZone);
Temporal.Now.plainDateTime('iso8601', timeZone);
});

View File

@ -13,5 +13,5 @@ var timeZone = {
};
assert.throws(Test262Error, function() {
Temporal.now.plainDateTime('iso8601', timeZone);
Temporal.Now.plainDateTime('iso8601', timeZone);
});

View File

@ -20,5 +20,5 @@ includes: [temporalHelpers.js]
].forEach((wrongOffset) => {
const timeZone = TemporalHelpers.specificOffsetTimeZone(wrongOffset);
assert.throws(TypeError, () => Temporal.now.plainDateTime("iso8601", timeZone));
assert.throws(TypeError, () => Temporal.Now.plainDateTime("iso8601", timeZone));
});

View File

@ -16,5 +16,5 @@ var timeZone = {
};
assert.throws(Test262Error, function() {
Temporal.now.plainDateTime("iso8601", timeZone);
Temporal.Now.plainDateTime("iso8601", timeZone);
});

View File

@ -13,5 +13,5 @@ var timeZone = {
};
assert.throws(Test262Error, function() {
Temporal.now.plainDateTime("iso8601", timeZone);
Temporal.Now.plainDateTime("iso8601", timeZone);
});

View File

@ -17,5 +17,5 @@ var timeZone = {
};
assert.throws(Test262Error, function() {
Temporal.now.plainDateTime("iso8601", timeZone);
Temporal.Now.plainDateTime("iso8601", timeZone);
});

View File

@ -15,5 +15,5 @@ var timeZone = new Proxy({}, {
});
assert.throws(Test262Error, function() {
Temporal.now.plainDateTime("iso8601", timeZone);
Temporal.Now.plainDateTime("iso8601", timeZone);
});

View File

@ -57,6 +57,6 @@ Object.defineProperty(Temporal.TimeZone, "from", {
},
});
Temporal.now.plainDateTime("iso8601", timeZone);
Temporal.Now.plainDateTime("iso8601", timeZone);
assert.compareArray(actual, expected);

View File

@ -3,7 +3,7 @@
/*---
esid: sec-temporal.now.timezone
description: Temporal.now.timeZone is extensible.
description: Temporal.Now.timeZone is extensible.
info: |
## 17 ECMAScript Standard Built-in Objects
@ -12,4 +12,4 @@ info: |
features: [Temporal]
---*/
assert(Object.isExtensible(Temporal.now.timeZone));
assert(Object.isExtensible(Temporal.Now.timeZone));

View File

@ -3,7 +3,7 @@
/*---
esid: sec-temporal.now.timezone
description: Temporal.now.timeZone.length is 0
description: Temporal.Now.timeZone.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
@ -17,7 +17,7 @@ includes: [propertyHelper.js]
features: [Temporal]
---*/
verifyProperty(Temporal.now.timeZone, "length", {
verifyProperty(Temporal.Now.timeZone, "length", {
value: 0,
writable: false,
enumerable: false,

View File

@ -3,7 +3,7 @@
/*---
esid: sec-temporal.now.timezone
description: Temporal.now.timeZone.name is "timeZone".
description: Temporal.Now.timeZone.name is "timeZone".
info: |
## 17 ECMAScript Standard Built-in Objects:
Every built-in Function object, including constructors, that is not
@ -17,9 +17,9 @@ includes: [propertyHelper.js]
features: [Temporal]
---*/
assert.sameValue(Temporal.now.timeZone.name, 'timeZone');
assert.sameValue(Temporal.Now.timeZone.name, 'timeZone');
verifyProperty(Temporal.now.timeZone, 'name', {
verifyProperty(Temporal.Now.timeZone, 'name', {
enumerable: false,
writable: false,
configurable: true

View File

@ -7,7 +7,7 @@ description: Each invocation of the function produces a distinct object value
features: [Temporal]
---*/
const tz = Temporal.now.timeZone;
const tz = Temporal.Now.timeZone;
const tz1 = tz();
const tz2 = tz();
assert.notSameValue(tz1, tz2);

View File

@ -3,7 +3,7 @@
/*---
esid: sec-temporal.now.timezone
description: Temporal.now.timeZone does not implement [[Construct]]
description: Temporal.Now.timeZone does not implement [[Construct]]
info: |
ECMAScript Function Objects
@ -14,8 +14,8 @@ includes: [isConstructor.js]
features: [Reflect.construct, Temporal]
---*/
assert.sameValue(isConstructor(Temporal.now.timeZone), false, 'isConstructor(Temporal.now.timeZone) must return false');
assert.sameValue(isConstructor(Temporal.Now.timeZone), false, 'isConstructor(Temporal.Now.timeZone) must return false');
assert.throws(TypeError, () => {
new Temporal.now.timeZone();
}, '`new Temporal.now.timeZone()` throws TypeError');
new Temporal.Now.timeZone();
}, '`new Temporal.Now.timeZone()` throws TypeError');

View File

@ -3,7 +3,7 @@
/*---
esid: sec-temporal.now.timezone
description: The "timeZone" property of Temporal.now
description: The "timeZone" property of Temporal.Now
info: |
Section 17: Every other data property described in clauses 18 through 26
and in Annex B.2 has the attributes { [[Writable]]: true,
@ -12,7 +12,7 @@ includes: [propertyHelper.js]
features: [Temporal]
---*/
verifyProperty(Temporal.now, 'timeZone', {
verifyProperty(Temporal.Now, 'timeZone', {
enumerable: false,
writable: true,
configurable: true

View File

@ -3,13 +3,13 @@
/*---
esid: sec-temporal.now.timezone
description: Temporal.now.timeZone returns an instance of the TimeZone constructor
description: Temporal.Now.timeZone returns an instance of the TimeZone constructor
info: |
1. Return ? SystemTimeZone().
features: [Temporal]
---*/
assert.sameValue(
Object.getPrototypeOf(Temporal.now.timeZone()),
Object.getPrototypeOf(Temporal.Now.timeZone()),
Temporal.TimeZone.prototype
);