-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This method returns an array of 0, 1, or 2 Temporal.Absolute objects that may correspond to a particular Temporal.DateTime in a particular Temporal.TimeZone. Closes: #318.
- Loading branch information
Showing
8 changed files
with
136 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
polyfill/test/TimeZone/prototype/possibleInstants/argument-not-datetime.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Copyright (C) 2020 Igalia, S.L. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
esid: sec-temporal.timezone.prototype.possibleinstants | ||
---*/ | ||
|
||
const timeZone = Temporal.TimeZone.from("UTC"); | ||
assert.throws(TypeError, () => timeZone.possibleInstants(undefined), "undefined"); | ||
assert.throws(TypeError, () => timeZone.possibleInstants(null), "null"); | ||
assert.throws(TypeError, () => timeZone.possibleInstants(true), "boolean"); | ||
assert.throws(TypeError, () => timeZone.possibleInstants("2020-01-02T12:34:56Z"), "string"); | ||
assert.throws(TypeError, () => timeZone.possibleInstants(Symbol()), "Symbol"); | ||
assert.throws(TypeError, () => timeZone.possibleInstants(5), "number"); | ||
assert.throws(TypeError, () => timeZone.possibleInstants(5n), "bigint"); | ||
assert.throws(TypeError, () => timeZone.possibleInstants({}), "plain object"); |
16 changes: 16 additions & 0 deletions
16
polyfill/test/TimeZone/prototype/possibleInstants/branding.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Copyright (C) 2020 Igalia, S.L. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
const possibleInstants = Temporal.TimeZone.prototype.possibleInstants; | ||
|
||
assert.sameValue(typeof possibleInstants, "function"); | ||
|
||
assert.throws(TypeError, () => possibleInstants.call(undefined), "undefined"); | ||
assert.throws(TypeError, () => possibleInstants.call(null), "null"); | ||
assert.throws(TypeError, () => possibleInstants.call(true), "true"); | ||
assert.throws(TypeError, () => possibleInstants.call(""), "empty string"); | ||
assert.throws(TypeError, () => possibleInstants.call(Symbol()), "symbol"); | ||
assert.throws(TypeError, () => possibleInstants.call(1), "1"); | ||
assert.throws(TypeError, () => possibleInstants.call({}), "plain object"); | ||
assert.throws(TypeError, () => possibleInstants.call(Temporal.TimeZone), "Temporal.TimeZone"); | ||
assert.throws(TypeError, () => possibleInstants.call(Temporal.TimeZone.prototype), "Temporal.TimeZone.prototype"); |
19 changes: 19 additions & 0 deletions
19
polyfill/test/TimeZone/prototype/possibleInstants/prop-desc.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Copyright (C) 2020 Igalia, S.L. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
includes: [propertyHelper.js] | ||
---*/ | ||
|
||
const { TimeZone } = Temporal; | ||
assert.sameValue( | ||
typeof TimeZone.prototype.possibleInstants, | ||
"function", | ||
"`typeof TimeZone.prototype.possibleInstants` is `function`" | ||
); | ||
|
||
verifyProperty(TimeZone.prototype, "possibleInstants", { | ||
writable: true, | ||
enumerable: false, | ||
configurable: true, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters