mirror of
https://github.com/tc39/test262.git
synced 2025-07-21 13:04:39 +02:00
Merge pull request #1585 from Ms2ger/Locale-branding
Add tests for branding checks in Intl.Locale.prototype members.
This commit is contained in:
commit
f71ce6d29a
30
test/intl402/Locale/prototype/baseName/branding.js
vendored
Normal file
30
test/intl402/Locale/prototype/baseName/branding.js
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
// 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));
|
||||
}
|
30
test/intl402/Locale/prototype/calendar/branding.js
vendored
Normal file
30
test/intl402/Locale/prototype/calendar/branding.js
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
// 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));
|
||||
}
|
32
test/intl402/Locale/prototype/caseFirst/branding.js
vendored
Normal file
32
test/intl402/Locale/prototype/caseFirst/branding.js
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
// 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));
|
||||
}
|
||||
}
|
30
test/intl402/Locale/prototype/collation/branding.js
vendored
Normal file
30
test/intl402/Locale/prototype/collation/branding.js
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
// 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));
|
||||
}
|
30
test/intl402/Locale/prototype/hourCycle/branding.js
vendored
Normal file
30
test/intl402/Locale/prototype/hourCycle/branding.js
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
// 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));
|
||||
}
|
30
test/intl402/Locale/prototype/language/branding.js
vendored
Normal file
30
test/intl402/Locale/prototype/language/branding.js
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
// 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));
|
||||
}
|
30
test/intl402/Locale/prototype/maximize/branding.js
vendored
Normal file
30
test/intl402/Locale/prototype/maximize/branding.js
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
// 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));
|
||||
}
|
30
test/intl402/Locale/prototype/minimize/branding.js
vendored
Normal file
30
test/intl402/Locale/prototype/minimize/branding.js
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
// 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));
|
||||
}
|
30
test/intl402/Locale/prototype/numberingSystem/branding.js
vendored
Normal file
30
test/intl402/Locale/prototype/numberingSystem/branding.js
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
// 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));
|
||||
}
|
32
test/intl402/Locale/prototype/numeric/branding.js
vendored
Normal file
32
test/intl402/Locale/prototype/numeric/branding.js
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
// 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));
|
||||
}
|
||||
}
|
30
test/intl402/Locale/prototype/region/branding.js
vendored
Normal file
30
test/intl402/Locale/prototype/region/branding.js
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
// 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));
|
||||
}
|
30
test/intl402/Locale/prototype/script/branding.js
vendored
Normal file
30
test/intl402/Locale/prototype/script/branding.js
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
// 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));
|
||||
}
|
30
test/intl402/Locale/prototype/toString/branding.js
vendored
Normal file
30
test/intl402/Locale/prototype/toString/branding.js
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
// 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));
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user