-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Polyfill: Add missing brand checks in TimeZone.
- Loading branch information
Showing
5 changed files
with
44 additions
and
41 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
21 changes: 21 additions & 0 deletions
21
polyfill/test/TimeZone/prototype/getInstantFor/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,21 @@ | ||
// Copyright (C) 2021 Igalia, S.L. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
esid: sec-temporal.timezone.prototype.getinstantfor | ||
features: [Symbol] | ||
---*/ | ||
|
||
const getInstantFor = Temporal.TimeZone.prototype.getInstantFor; | ||
|
||
assert.sameValue(typeof getInstantFor, "function"); | ||
|
||
assert.throws(TypeError, () => getInstantFor.call(undefined), "undefined"); | ||
assert.throws(TypeError, () => getInstantFor.call(null), "null"); | ||
assert.throws(TypeError, () => getInstantFor.call(true), "true"); | ||
assert.throws(TypeError, () => getInstantFor.call(""), "empty string"); | ||
assert.throws(TypeError, () => getInstantFor.call(Symbol()), "symbol"); | ||
assert.throws(TypeError, () => getInstantFor.call(1), "1"); | ||
assert.throws(TypeError, () => getInstantFor.call({}), "plain object"); | ||
assert.throws(TypeError, () => getInstantFor.call(Temporal.TimeZone), "Temporal.TimeZone"); | ||
assert.throws(TypeError, () => getInstantFor.call(Temporal.TimeZone.prototype), "Temporal.TimeZone.prototype"); |
21 changes: 21 additions & 0 deletions
21
polyfill/test/TimeZone/prototype/getOffsetStringFor/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,21 @@ | ||
// Copyright (C) 2021 Igalia, S.L. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
esid: sec-temporal.timezone.prototype.getoffsetstringfor | ||
features: [Symbol] | ||
---*/ | ||
|
||
const getOffsetStringFor = Temporal.TimeZone.prototype.getOffsetStringFor; | ||
|
||
assert.sameValue(typeof getOffsetStringFor, "function"); | ||
|
||
assert.throws(TypeError, () => getOffsetStringFor.call(undefined), "undefined"); | ||
assert.throws(TypeError, () => getOffsetStringFor.call(null), "null"); | ||
assert.throws(TypeError, () => getOffsetStringFor.call(true), "true"); | ||
assert.throws(TypeError, () => getOffsetStringFor.call(""), "empty string"); | ||
assert.throws(TypeError, () => getOffsetStringFor.call(Symbol()), "symbol"); | ||
assert.throws(TypeError, () => getOffsetStringFor.call(1), "1"); | ||
assert.throws(TypeError, () => getOffsetStringFor.call({}), "plain object"); | ||
assert.throws(TypeError, () => getOffsetStringFor.call(Temporal.TimeZone), "Temporal.TimeZone"); | ||
assert.throws(TypeError, () => getOffsetStringFor.call(Temporal.TimeZone.prototype), "Temporal.TimeZone.prototype"); |
35 changes: 0 additions & 35 deletions
35
polyfill/test/TimeZone/prototype/getOffsetStringFor/custom-timezone.js
This file was deleted.
Oops, something went wrong.
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