Skip to content
Snippets Groups Projects
Commit 326fe2b8 authored by Ms2ger's avatar Ms2ger
Browse files

Add tests for branding checks in Intl.Locale.prototype members.

parent 92003a3e
Branches
No related tags found
No related merge requests found
Showing
with 394 additions and 0 deletions
// Copyright 2018 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.Locale.prototype.baseName
description: >
Verifies the branding check for the "baseName" property of the Locale prototype object.
info: |
Intl.Locale.prototype.baseName
2. If Type(loc) is not Object or loc does not have an [[InitializedLocale]] internal slot, then
a. Throw a TypeError exception.
features: [Intl.Locale]
---*/
const propdesc = Object.getOwnPropertyDescriptor(Intl.Locale.prototype, "baseName");
const invalidValues = [
undefined,
null,
true,
"",
Symbol(),
1,
{},
Intl.Locale.prototype,
];
for (const invalidValue of invalidValues) {
assert.throws(TypeError, () => propdesc.get.call(invalidValue));
}
// Copyright 2018 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.Locale.prototype.calendar
description: >
Verifies the branding check for the "calendar" property of the Locale prototype object.
info: |
Intl.Locale.prototype.calendar
2. If Type(loc) is not Object or loc does not have an [[InitializedLocale]] internal slot, then
a. Throw a TypeError exception.
features: [Intl.Locale]
---*/
const propdesc = Object.getOwnPropertyDescriptor(Intl.Locale.prototype, "calendar");
const invalidValues = [
undefined,
null,
true,
"",
Symbol(),
1,
{},
Intl.Locale.prototype,
];
for (const invalidValue of invalidValues) {
assert.throws(TypeError, () => propdesc.get.call(invalidValue));
}
// Copyright 2018 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.Locale.prototype.caseFirst
description: >
Verifies the branding check for the "caseFirst" property of the Locale prototype object.
info: |
Intl.Locale.prototype.caseFirst
2. If Type(loc) is not Object or loc does not have an [[InitializedLocale]] internal slot, then
a. Throw a TypeError exception.
features: [Intl.Locale]
---*/
const propdesc = Object.getOwnPropertyDescriptor(Intl.Locale.prototype, "caseFirst");
if (propdesc !== undefined) {
const invalidValues = [
undefined,
null,
true,
"",
Symbol(),
1,
{},
Intl.Locale.prototype,
];
for (const invalidValue of invalidValues) {
assert.throws(TypeError, () => propdesc.get.call(invalidValue));
}
}
// Copyright 2018 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.Locale.prototype.collation
description: >
Verifies the branding check for the "collation" property of the Locale prototype object.
info: |
Intl.Locale.prototype.collation
2. If Type(loc) is not Object or loc does not have an [[InitializedLocale]] internal slot, then
a. Throw a TypeError exception.
features: [Intl.Locale]
---*/
const propdesc = Object.getOwnPropertyDescriptor(Intl.Locale.prototype, "collation");
const invalidValues = [
undefined,
null,
true,
"",
Symbol(),
1,
{},
Intl.Locale.prototype,
];
for (const invalidValue of invalidValues) {
assert.throws(TypeError, () => propdesc.get.call(invalidValue));
}
// Copyright 2018 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.Locale.prototype.hourCycle
description: >
Verifies the branding check for the "hourCycle" property of the Locale prototype object.
info: |
Intl.Locale.prototype.hourCycle
2. If Type(loc) is not Object or loc does not have an [[InitializedLocale]] internal slot, then
a. Throw a TypeError exception.
features: [Intl.Locale]
---*/
const propdesc = Object.getOwnPropertyDescriptor(Intl.Locale.prototype, "hourCycle");
const invalidValues = [
undefined,
null,
true,
"",
Symbol(),
1,
{},
Intl.Locale.prototype,
];
for (const invalidValue of invalidValues) {
assert.throws(TypeError, () => propdesc.get.call(invalidValue));
}
// Copyright 2018 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.Locale.prototype.language
description: >
Verifies the branding check for the "language" property of the Locale prototype object.
info: |
Intl.Locale.prototype.language
2. If Type(loc) is not Object or loc does not have an [[InitializedLocale]] internal slot, then
a. Throw a TypeError exception.
features: [Intl.Locale]
---*/
const propdesc = Object.getOwnPropertyDescriptor(Intl.Locale.prototype, "language");
const invalidValues = [
undefined,
null,
true,
"",
Symbol(),
1,
{},
Intl.Locale.prototype,
];
for (const invalidValue of invalidValues) {
assert.throws(TypeError, () => propdesc.get.call(invalidValue));
}
// Copyright 2018 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.Locale.prototype.maximize
description: >
Verifies the branding check for the "maximize" function of the Locale prototype object.
info: |
Intl.Locale.prototype.maximize
2. If Type(loc) is not Object or loc does not have an [[InitializedLocale]] internal slot, then
a. Throw a TypeError exception.
features: [Intl.Locale]
---*/
const fn = Intl.Locale.prototype.maximize;
const invalidValues = [
undefined,
null,
true,
"",
Symbol(),
1,
{},
Intl.Locale.prototype,
];
for (const invalidValue of invalidValues) {
assert.throws(TypeError, () => fn.call(invalidValue));
}
// Copyright 2018 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.Locale.prototype.minimize
description: >
Verifies the branding check for the "minimize" function of the Locale prototype object.
info: |
Intl.Locale.prototype.minimize
2. If Type(loc) is not Object or loc does not have an [[InitializedLocale]] internal slot, then
a. Throw a TypeError exception.
features: [Intl.Locale]
---*/
const fn = Intl.Locale.prototype.minimize;
const invalidValues = [
undefined,
null,
true,
"",
Symbol(),
1,
{},
Intl.Locale.prototype,
];
for (const invalidValue of invalidValues) {
assert.throws(TypeError, () => fn.call(invalidValue));
}
// Copyright 2018 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.Locale.prototype.numberingSystem
description: >
Verifies the branding check for the "numberingSystem" property of the Locale prototype object.
info: |
Intl.Locale.prototype.numberingSystem
2. If Type(loc) is not Object or loc does not have an [[InitializedLocale]] internal slot, then
a. Throw a TypeError exception.
features: [Intl.Locale]
---*/
const propdesc = Object.getOwnPropertyDescriptor(Intl.Locale.prototype, "numberingSystem");
const invalidValues = [
undefined,
null,
true,
"",
Symbol(),
1,
{},
Intl.Locale.prototype,
];
for (const invalidValue of invalidValues) {
assert.throws(TypeError, () => propdesc.get.call(invalidValue));
}
// Copyright 2018 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.Locale.prototype.numeric
description: >
Verifies the branding check for the "numeric" property of the Locale prototype object.
info: |
Intl.Locale.prototype.numeric
2. If Type(loc) is not Object or loc does not have an [[InitializedLocale]] internal slot, then
a. Throw a TypeError exception.
features: [Intl.Locale]
---*/
const propdesc = Object.getOwnPropertyDescriptor(Intl.Locale.prototype, "numeric");
if (propdesc !== undefined) {
const invalidValues = [
undefined,
null,
true,
"",
Symbol(),
1,
{},
Intl.Locale.prototype,
];
for (const invalidValue of invalidValues) {
assert.throws(TypeError, () => propdesc.get.call(invalidValue));
}
}
// Copyright 2018 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.Locale.prototype.region
description: >
Verifies the branding check for the "region" property of the Locale prototype object.
info: |
Intl.Locale.prototype.region
2. If Type(loc) is not Object or loc does not have an [[InitializedLocale]] internal slot, then
a. Throw a TypeError exception.
features: [Intl.Locale]
---*/
const propdesc = Object.getOwnPropertyDescriptor(Intl.Locale.prototype, "region");
const invalidValues = [
undefined,
null,
true,
"",
Symbol(),
1,
{},
Intl.Locale.prototype,
];
for (const invalidValue of invalidValues) {
assert.throws(TypeError, () => propdesc.get.call(invalidValue));
}
// Copyright 2018 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.Locale.prototype.script
description: >
Verifies the branding check for the "script" property of the Locale prototype object.
info: |
Intl.Locale.prototype.script
2. If Type(loc) is not Object or loc does not have an [[InitializedLocale]] internal slot, then
a. Throw a TypeError exception.
features: [Intl.Locale]
---*/
const propdesc = Object.getOwnPropertyDescriptor(Intl.Locale.prototype, "script");
const invalidValues = [
undefined,
null,
true,
"",
Symbol(),
1,
{},
Intl.Locale.prototype,
];
for (const invalidValue of invalidValues) {
assert.throws(TypeError, () => propdesc.get.call(invalidValue));
}
// Copyright 2018 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.Locale.prototype.toString
description: >
Verifies the branding check for the "toString" function of the Locale prototype object.
info: |
Intl.Locale.prototype.toString
2. If Type(loc) is not Object or loc does not have an [[InitializedLocale]] internal slot, then
a. Throw a TypeError exception.
features: [Intl.Locale]
---*/
const fn = Intl.Locale.prototype.toString;
const invalidValues = [
undefined,
null,
true,
"",
Symbol(),
1,
{},
Intl.Locale.prototype,
];
for (const invalidValue of invalidValues) {
assert.throws(TypeError, () => fn.call(invalidValue));
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment