Sync Intl Locale API tests w/ PR67

https://github.com/tc39/proposal-intl-locale-info/pull/67
This commit is contained in:
Frank Tang 2023-03-20 18:00:42 -07:00 committed by Ms2ger
parent 1bb53aee3e
commit bba19d51ae
54 changed files with 533 additions and 579 deletions

View File

@ -1,31 +0,0 @@
// Copyright 2021 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.Locale.prototype.calendars
description: >
Verifies the branding check for the "calendars" property of the Locale prototype object.
info: |
Intl.Locale.prototype.calendars
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,Intl.Locale-info]
---*/
const propdesc = Object.getOwnPropertyDescriptor(Intl.Locale.prototype, "calendars");
assert.sameValue(typeof propdesc.get, "function");
const invalidValues = [
undefined,
null,
true,
"",
Symbol(),
1,
{},
Intl.Locale.prototype,
];
for (const invalidValue of invalidValues) {
assert.throws(TypeError, () => propdesc.get.call(invalidValue));
}

View File

@ -1,25 +0,0 @@
// Copyright 2021 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-intl.locale
description: >
Checks the "calendars" property of the Locale prototype object.
info: |
Intl.Locale.prototype.calendars
Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 script Specification, 10th edition, clause 17, or successor.
Every accessor property described in clauses 18 through 26 and in Annex B.2 has the attributes { [[Enumerable]]: false, [[Configurable]]: true } unless otherwise specified. If only a get accessor function is described, the set accessor function is the default value, undefined.
includes: [propertyHelper.js]
features: [Intl.Locale,Intl.Locale-info]
---*/
const propdesc = Object.getOwnPropertyDescriptor(Intl.Locale.prototype, "calendars");
assert.sameValue(propdesc.set, undefined);
assert.sameValue(typeof propdesc.get, "function");
verifyProperty(Intl.Locale.prototype, "calendars", {
enumerable: false,
configurable: true,
});

View File

@ -1,31 +0,0 @@
// Copyright 2021 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.Locale.prototype.collations
description: >
Verifies the branding check for the "collations" property of the Locale prototype object.
info: |
Intl.Locale.prototype.collations
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,Intl.Locale-info]
---*/
const propdesc = Object.getOwnPropertyDescriptor(Intl.Locale.prototype, "collations");
assert.sameValue(typeof propdesc.get, "function");
const invalidValues = [
undefined,
null,
true,
"",
Symbol(),
1,
{},
Intl.Locale.prototype,
];
for (const invalidValue of invalidValues) {
assert.throws(TypeError, () => propdesc.get.call(invalidValue));
}

View File

@ -1,22 +0,0 @@
// Copyright 2021 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-intl.locale.prototype.collations
description: >
Checks the "name" property of Intl.Locale.prototype.collations.
info: |
Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 Language Specification, 10th edition, clause 17, or successor.
Every built-in function object, including constructors, that is not identified as an anonymous function has a name property whose value is a String. Unless otherwise specified, this value is the name that is given to the function in this specification. Functions that are specified as get or set accessor functions of built-in properties have "get " or "set " prepended to the property name string.
Unless otherwise specified, the name property of a built-in function object, if it exists, has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }.
includes: [propertyHelper.js]
features: [Intl.Locale,Intl.Locale-info]
---*/
const getter = Object.getOwnPropertyDescriptor(Intl.Locale.prototype, "collations").get;
verifyProperty(getter, "name", {
value: "get collations",
writable: false,
enumerable: false,
configurable: true,
});

View File

@ -1,25 +0,0 @@
// Copyright 2021 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-intl.locale
description: >
Checks the "collations" property of the Locale prototype object.
info: |
Intl.Locale.prototype.collations
Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 script Specification, 10th edition, clause 17, or successor.
Every accessor property described in clauses 18 through 26 and in Annex B.2 has the attributes { [[Enumerable]]: false, [[Configurable]]: true } unless otherwise specified. If only a get accessor function is described, the set accessor function is the default value, undefined.
includes: [propertyHelper.js]
features: [Intl.Locale,Intl.Locale-info]
---*/
const propdesc = Object.getOwnPropertyDescriptor(Intl.Locale.prototype, "collations");
assert.sameValue(propdesc.set, undefined);
assert.sameValue(typeof propdesc.get, "function");
verifyProperty(Intl.Locale.prototype, "collations", {
enumerable: false,
configurable: true,
});

View File

@ -0,0 +1,27 @@
// Copyright 2023 Google Inc. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.Locale.prototype.getCalendars
description: Verifies the branding check for the "getCalendars" function of the Locale prototype object.
info: |
Intl.Locale.prototype.getCalendars ()
2. Perform ? RequireInternalSlot(loc, [[InitializedLocale]]).
features: [Intl.Locale,Intl.Locale-info]
---*/
const getCalendars = Intl.Locale.prototype.getCalendars;
assert.sameValue(typeof getCalendars, "function");
assert.throws(TypeError, () => getCalendars.call(undefined), "undefined");
assert.throws(TypeError, () => getCalendars.call(null), "null");
assert.throws(TypeError, () => getCalendars.call(true), "true");
assert.throws(TypeError, () => getCalendars.call(""), "empty string");
assert.throws(TypeError, () => getCalendars.call(Symbol()), "symbol");
assert.throws(TypeError, () => getCalendars.call(1), "1");
assert.throws(TypeError, () => getCalendars.call({}), "plain object");
assert.throws(TypeError, () => getCalendars.call(Intl.Locale), "Intl.Locale");
assert.throws(TypeError, () => getCalendars.call(Intl.Locale.prototype), "Intl.Locale.prototype");

View File

@ -1,21 +1,19 @@
// Copyright 2021 Igalia, S.L. All rights reserved. // Copyright 2023 Google Inc. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
esid: sec-intl.locale.prototype.weekInfo esid: sec-Intl.Locale.prototype.getCalendars
description: > description: Checks the "name" property of Intl.Locale.prototype.getCalendars().
Checks the "name" property of Intl.Locale.prototype.weekInfo.
info: | info: |
Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 Language Specification, 10th edition, clause 17, or successor. Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 Language Specification, 10th edition, clause 17, or successor.
Every built-in function object, including constructors, that is not identified as an anonymous function has a name property whose value is a String. Unless otherwise specified, this value is the name that is given to the function in this specification. Functions that are specified as get or set accessor functions of built-in properties have "get " or "set " prepended to the property name string. Every built-in function object, including constructors, that is not identified as an anonymous function has a name property whose value is a String. Unless otherwise specified, this value is the name that is given to the function in this specification.
Unless otherwise specified, the name property of a built-in function object, if it exists, has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }. Unless otherwise specified, the name property of a built-in function object, if it exists, has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }.
includes: [propertyHelper.js] includes: [propertyHelper.js]
features: [Intl.Locale,Intl.Locale-info] features: [Intl.Locale,Intl.Locale-info]
---*/ ---*/
const getter = Object.getOwnPropertyDescriptor(Intl.Locale.prototype, "weekInfo").get; verifyProperty(Intl.Locale.prototype.getCalendars, "name", {
verifyProperty(getter, "name", { value: "getCalendars",
value: "get weekInfo",
writable: false, writable: false,
enumerable: false, enumerable: false,
configurable: true, configurable: true,

View File

@ -2,9 +2,9 @@
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
esid: sec-intl.locale.prototype.calendars esid: sec-intl.locale.prototype.getCalendars
description: > description: >
Checks that the return value of Intl.Locale.prototype.calendars is an Array. Checks that the return value of Intl.Locale.prototype.getCalendars is an Array.
info: | info: |
CalendarsOfLocale ( loc ) CalendarsOfLocale ( loc )
... ...
@ -12,5 +12,5 @@ info: |
features: [Intl.Locale,Intl.Locale-info] features: [Intl.Locale,Intl.Locale-info]
---*/ ---*/
assert(Array.isArray(new Intl.Locale('en').calendars)); assert(Array.isArray(new Intl.Locale('en').getCalendars()));
assert(new Intl.Locale('en').calendars.length > 0, 'array has at least one element'); assert(new Intl.Locale('en').getCalendars().length > 0, 'array has at least one element');

View File

@ -0,0 +1,25 @@
// Copyright 2023 Google Inc. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.Locale.prototype.getCalendars
description: Checks the "getCalendars" property of the Locale prototype object.
info: |
Intl.Locale.prototype.getCalendars ()
Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 Language Specification, 10th edition, clause 17, or successor.
Every other data property described in clauses 18 through 26 and in Annex B.2 has the attributes { [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: true } unless otherwise specified.
includes: [propertyHelper.js]
features: [Intl.Locale,Intl.Locale-info]
---*/
assert.sameValue(
typeof Intl.Locale.prototype.getCalendars,
"function",
"typeof Intl.Locale.prototype.getCalendars is function"
);
verifyProperty(Intl.Locale.prototype, "getCalendars", {
writable: true,
enumerable: false,
configurable: true,
});

View File

@ -0,0 +1,27 @@
// Copyright 2023 Google Inc. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.Locale.prototype.getCollations
description: Verifies the branding check for the "getCollations" function of the Locale prototype object.
info: |
Intl.Locale.prototype.getCollations ()
2. Perform ? RequireInternalSlot(loc, [[InitializedLocale]]).
features: [Intl.Locale,Intl.Locale-info]
---*/
const getCollations = Intl.Locale.prototype.getCollations;
assert.sameValue(typeof getCollations, "function");
assert.throws(TypeError, () => getCollations.call(undefined), "undefined");
assert.throws(TypeError, () => getCollations.call(null), "null");
assert.throws(TypeError, () => getCollations.call(true), "true");
assert.throws(TypeError, () => getCollations.call(""), "empty string");
assert.throws(TypeError, () => getCollations.call(Symbol()), "symbol");
assert.throws(TypeError, () => getCollations.call(1), "1");
assert.throws(TypeError, () => getCollations.call({}), "plain object");
assert.throws(TypeError, () => getCollations.call(Intl.Locale), "Intl.Locale");
assert.throws(TypeError, () => getCollations.call(Intl.Locale.prototype), "Intl.Locale.prototype");

View File

@ -1,21 +1,19 @@
// Copyright 2021 Igalia, S.L. All rights reserved. // Copyright 2023 Google Inc. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
esid: sec-intl.locale.prototype.textInfo esid: sec-Intl.Locale.prototype.getCollations
description: > description: Checks the "name" property of Intl.Locale.prototype.getCollations().
Checks the "name" property of Intl.Locale.prototype.textInfo.
info: | info: |
Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 Language Specification, 10th edition, clause 17, or successor. Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 Language Specification, 10th edition, clause 17, or successor.
Every built-in function object, including constructors, that is not identified as an anonymous function has a name property whose value is a String. Unless otherwise specified, this value is the name that is given to the function in this specification. Functions that are specified as get or set accessor functions of built-in properties have "get " or "set " prepended to the property name string. Every built-in function object, including constructors, that is not identified as an anonymous function has a name property whose value is a String. Unless otherwise specified, this value is the name that is given to the function in this specification.
Unless otherwise specified, the name property of a built-in function object, if it exists, has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }. Unless otherwise specified, the name property of a built-in function object, if it exists, has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }.
includes: [propertyHelper.js] includes: [propertyHelper.js]
features: [Intl.Locale,Intl.Locale-info] features: [Intl.Locale,Intl.Locale-info]
---*/ ---*/
const getter = Object.getOwnPropertyDescriptor(Intl.Locale.prototype, "textInfo").get; verifyProperty(Intl.Locale.prototype.getCollations, "name", {
verifyProperty(getter, "name", { value: "getCollations",
value: "get textInfo",
writable: false, writable: false,
enumerable: false, enumerable: false,
configurable: true, configurable: true,

View File

@ -17,7 +17,7 @@ info: |
features: [Intl.Locale, Intl.Locale-info, Array.prototype.includes] features: [Intl.Locale, Intl.Locale-info, Array.prototype.includes]
---*/ ---*/
const output = new Intl.Locale('en').collations; const output = new Intl.Locale('en').getCollations();
assert(output.length > 0, 'array has at least one element'); assert(output.length > 0, 'array has at least one element');
output.forEach(c => { output.forEach(c => {
if(['standard', 'search'].includes(c)) if(['standard', 'search'].includes(c))

View File

@ -2,9 +2,9 @@
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
esid: sec-intl.locale.prototype.collations esid: sec-intl.locale.prototype.getCollations
description: > description: >
Checks that the return value of Intl.Locale.prototype.collations is an Array. Checks that the return value of Intl.Locale.prototype.getCollations is an Array.
info: | info: |
CollationsOfLocale ( loc ) CollationsOfLocale ( loc )
... ...
@ -12,4 +12,4 @@ info: |
features: [Intl.Locale,Intl.Locale-info] features: [Intl.Locale,Intl.Locale-info]
---*/ ---*/
assert(Array.isArray(new Intl.Locale('en').collations)); assert(Array.isArray(new Intl.Locale('en').getCollations()));

View File

@ -0,0 +1,25 @@
// Copyright 2023 Google Inc. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.Locale.prototype.getCollations
description: Checks the "getCollations" property of the Locale prototype object.
info: |
Intl.Locale.prototype.getCollations ()
Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 Language Specification, 10th edition, clause 17, or successor.
Every other data property described in clauses 18 through 26 and in Annex B.2 has the attributes { [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: true } unless otherwise specified.
includes: [propertyHelper.js]
features: [Intl.Locale,Intl.Locale-info]
---*/
assert.sameValue(
typeof Intl.Locale.prototype.getCollations,
"function",
"typeof Intl.Locale.prototype.getCollations is function"
);
verifyProperty(Intl.Locale.prototype, "getCollations", {
writable: true,
enumerable: false,
configurable: true,
});

View File

@ -0,0 +1,27 @@
// Copyright 2023 Google Inc. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.Locale.prototype.getHourCycles
description: Verifies the branding check for the "getHourCycles" function of the Locale prototype object.
info: |
Intl.Locale.prototype.getHourCycles ()
2. Perform ? RequireInternalSlot(loc, [[InitializedLocale]]).
features: [Intl.Locale,Intl.Locale-info]
---*/
const getHourCycles = Intl.Locale.prototype.getHourCycles;
assert.sameValue(typeof getHourCycles, "function");
assert.throws(TypeError, () => getHourCycles.call(undefined), "undefined");
assert.throws(TypeError, () => getHourCycles.call(null), "null");
assert.throws(TypeError, () => getHourCycles.call(true), "true");
assert.throws(TypeError, () => getHourCycles.call(""), "empty string");
assert.throws(TypeError, () => getHourCycles.call(Symbol()), "symbol");
assert.throws(TypeError, () => getHourCycles.call(1), "1");
assert.throws(TypeError, () => getHourCycles.call({}), "plain object");
assert.throws(TypeError, () => getHourCycles.call(Intl.Locale), "Intl.Locale");
assert.throws(TypeError, () => getHourCycles.call(Intl.Locale.prototype), "Intl.Locale.prototype");

View File

@ -1,21 +1,19 @@
// Copyright 2021 Igalia, S.L. All rights reserved. // Copyright 2023 Google Inc. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
esid: sec-intl.locale.prototype.timeZones esid: sec-Intl.Locale.prototype.getHourCycles
description: > description: Checks the "name" property of Intl.Locale.prototype.getHourCycles().
Checks the "name" property of Intl.Locale.prototype.timeZones.
info: | info: |
Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 Language Specification, 10th edition, clause 17, or successor. Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 Language Specification, 10th edition, clause 17, or successor.
Every built-in function object, including constructors, that is not identified as an anonymous function has a name property whose value is a String. Unless otherwise specified, this value is the name that is given to the function in this specification. Functions that are specified as get or set accessor functions of built-in properties have "get " or "set " prepended to the property name string. Every built-in function object, including constructors, that is not identified as an anonymous function has a name property whose value is a String. Unless otherwise specified, this value is the name that is given to the function in this specification.
Unless otherwise specified, the name property of a built-in function object, if it exists, has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }. Unless otherwise specified, the name property of a built-in function object, if it exists, has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }.
includes: [propertyHelper.js] includes: [propertyHelper.js]
features: [Intl.Locale,Intl.Locale-info] features: [Intl.Locale,Intl.Locale-info]
---*/ ---*/
const getter = Object.getOwnPropertyDescriptor(Intl.Locale.prototype, "timeZones").get; verifyProperty(Intl.Locale.prototype.getHourCycles, "name", {
verifyProperty(getter, "name", { value: "getHourCycles",
value: "get timeZones",
writable: false, writable: false,
enumerable: false, enumerable: false,
configurable: true, configurable: true,

View File

@ -2,9 +2,9 @@
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
esid: sec-intl.locale.prototype.hourCycles esid: sec-intl.locale.prototype.getHourCycles
description: > description: >
Checks that the return value of Intl.Locale.prototype.hourCycles is an Array Checks that the return value of Intl.Locale.prototype.getHourCycles is an Array
that only contains valid values. that only contains valid values.
info: | info: |
HourCyclesOfLocale ( loc ) HourCyclesOfLocale ( loc )
@ -16,7 +16,7 @@ info: |
features: [Intl.Locale, Intl.Locale-info, Array.prototype.includes] features: [Intl.Locale, Intl.Locale-info, Array.prototype.includes]
---*/ ---*/
const output = new Intl.Locale('en').hourCycles; const output = new Intl.Locale('en').getHourCycles();
assert(output.length > 0, 'array has at least one element'); assert(output.length > 0, 'array has at least one element');
output.forEach(hc => { output.forEach(hc => {
if(!['h11', 'h12', 'h23', 'h24'].includes(hc)) if(!['h11', 'h12', 'h23', 'h24'].includes(hc))

View File

@ -2,9 +2,9 @@
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
esid: sec-intl.locale.prototype.hourCycles esid: sec-intl.locale.prototype.getHourCycles
description: > description: >
Checks that the return value of Intl.Locale.prototype.hourCycles is an Array. Checks that the return value of Intl.Locale.prototype.getHourCycles is an Array.
info: | info: |
HourCyclesOfLocale ( loc ) HourCyclesOfLocale ( loc )
... ...
@ -12,4 +12,4 @@ info: |
features: [Intl.Locale,Intl.Locale-info] features: [Intl.Locale,Intl.Locale-info]
---*/ ---*/
assert(Array.isArray(new Intl.Locale('en').hourCycles)); assert(Array.isArray(new Intl.Locale('en').getHourCycles()));

View File

@ -0,0 +1,25 @@
// Copyright 2023 Google Inc. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.Locale.prototype.getHourCycles
description: Checks the "getHourCycles" property of the Locale prototype object.
info: |
Intl.Locale.prototype.getHourCycles ()
Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 Language Specification, 10th edition, clause 17, or successor.
Every other data property described in clauses 18 through 26 and in Annex B.2 has the attributes { [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: true } unless otherwise specified.
includes: [propertyHelper.js]
features: [Intl.Locale,Intl.Locale-info]
---*/
assert.sameValue(
typeof Intl.Locale.prototype.getHourCycles,
"function",
"typeof Intl.Locale.prototype.getHourCycles is function"
);
verifyProperty(Intl.Locale.prototype, "getHourCycles", {
writable: true,
enumerable: false,
configurable: true,
});

View File

@ -0,0 +1,27 @@
// Copyright 2023 Google Inc. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.Locale.prototype.getNumberingSystems
description: Verifies the branding check for the "getNumberingSystems" function of the Locale prototype object.
info: |
Intl.Locale.prototype.getNumberingSystems ()
2. Perform ? RequireInternalSlot(loc, [[InitializedLocale]]).
features: [Intl.Locale,Intl.Locale-info]
---*/
const getNumberingSystems = Intl.Locale.prototype.getNumberingSystems;
assert.sameValue(typeof getNumberingSystems, "function");
assert.throws(TypeError, () => getNumberingSystems.call(undefined), "undefined");
assert.throws(TypeError, () => getNumberingSystems.call(null), "null");
assert.throws(TypeError, () => getNumberingSystems.call(true), "true");
assert.throws(TypeError, () => getNumberingSystems.call(""), "empty string");
assert.throws(TypeError, () => getNumberingSystems.call(Symbol()), "symbol");
assert.throws(TypeError, () => getNumberingSystems.call(1), "1");
assert.throws(TypeError, () => getNumberingSystems.call({}), "plain object");
assert.throws(TypeError, () => getNumberingSystems.call(Intl.Locale), "Intl.Locale");
assert.throws(TypeError, () => getNumberingSystems.call(Intl.Locale.prototype), "Intl.Locale.prototype");

View File

@ -1,21 +1,19 @@
// Copyright 2021 Igalia, S.L. All rights reserved. // Copyright 2023 Google Inc. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
esid: sec-intl.locale.prototype.calendars esid: sec-Intl.Locale.prototype.getNumberingSystems
description: > description: Checks the "name" property of Intl.Locale.prototype.getNumberingSystems().
Checks the "name" property of Intl.Locale.prototype.calendars.
info: | info: |
Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 Language Specification, 10th edition, clause 17, or successor. Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 Language Specification, 10th edition, clause 17, or successor.
Every built-in function object, including constructors, that is not identified as an anonymous function has a name property whose value is a String. Unless otherwise specified, this value is the name that is given to the function in this specification. Functions that are specified as get or set accessor functions of built-in properties have "get " or "set " prepended to the property name string. Every built-in function object, including constructors, that is not identified as an anonymous function has a name property whose value is a String. Unless otherwise specified, this value is the name that is given to the function in this specification.
Unless otherwise specified, the name property of a built-in function object, if it exists, has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }. Unless otherwise specified, the name property of a built-in function object, if it exists, has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }.
includes: [propertyHelper.js] includes: [propertyHelper.js]
features: [Intl.Locale,Intl.Locale-info] features: [Intl.Locale,Intl.Locale-info]
---*/ ---*/
const getter = Object.getOwnPropertyDescriptor(Intl.Locale.prototype, "calendars").get; verifyProperty(Intl.Locale.prototype.getNumberingSystems, "name", {
verifyProperty(getter, "name", { value: "getNumberingSystems",
value: "get calendars",
writable: false, writable: false,
enumerable: false, enumerable: false,
configurable: true, configurable: true,

View File

@ -0,0 +1,16 @@
// Copyright 2021 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-intl.locale.prototype.getNumberingSystems
description: >
Checks that the return value of Intl.Locale.prototype.getNumberingSystems is an Array.
info: |
NumberingSystemsOfLocale ( loc )
...
5. Return ! CreateArrayFromListAndPreferred( list, preferred ).
features: [Intl.Locale,Intl.Locale-info]
---*/
assert(Array.isArray(new Intl.Locale('en').getNumberingSystems()));
assert(new Intl.Locale('en').getNumberingSystems().length > 0, 'array has at least one element');

View File

@ -0,0 +1,25 @@
// Copyright 2023 Google Inc. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.Locale.prototype.getNumberingSystems
description: Checks the "getNumberingSystems" property of the Locale prototype object.
info: |
Intl.Locale.prototype.getNumberingSystems ()
Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 Language Specification, 10th edition, clause 17, or successor.
Every other data property described in clauses 18 through 26 and in Annex B.2 has the attributes { [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: true } unless otherwise specified.
includes: [propertyHelper.js]
features: [Intl.Locale,Intl.Locale-info]
---*/
assert.sameValue(
typeof Intl.Locale.prototype.getNumberingSystems,
"function",
"typeof Intl.Locale.prototype.getNumberingSystems is function"
);
verifyProperty(Intl.Locale.prototype, "getNumberingSystems", {
writable: true,
enumerable: false,
configurable: true,
});

View File

@ -0,0 +1,27 @@
// Copyright 2023 Google Inc. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.Locale.prototype.getTextInfo
description: Verifies the branding check for the "getTextInfo" function of the Locale prototype object.
info: |
Intl.Locale.prototype.getTextInfo ()
2. Perform ? RequireInternalSlot(loc, [[InitializedLocale]]).
features: [Intl.Locale,Intl.Locale-info]
---*/
const getTextInfo = Intl.Locale.prototype.getTextInfo;
assert.sameValue(typeof getTextInfo, "function");
assert.throws(TypeError, () => getTextInfo.call(undefined), "undefined");
assert.throws(TypeError, () => getTextInfo.call(null), "null");
assert.throws(TypeError, () => getTextInfo.call(true), "true");
assert.throws(TypeError, () => getTextInfo.call(""), "empty string");
assert.throws(TypeError, () => getTextInfo.call(Symbol()), "symbol");
assert.throws(TypeError, () => getTextInfo.call(1), "1");
assert.throws(TypeError, () => getTextInfo.call({}), "plain object");
assert.throws(TypeError, () => getTextInfo.call(Intl.Locale), "Intl.Locale");
assert.throws(TypeError, () => getTextInfo.call(Intl.Locale.prototype), "Intl.Locale.prototype");

View File

@ -0,0 +1,20 @@
// Copyright 2023 Google Inc. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.Locale.prototype.getTextInfo
description: Checks the "name" property of Intl.Locale.prototype.getTextInfo().
info: |
Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 Language Specification, 10th edition, clause 17, or successor.
Every built-in function object, including constructors, that is not identified as an anonymous function has a name property whose value is a String. Unless otherwise specified, this value is the name that is given to the function in this specification.
Unless otherwise specified, the name property of a built-in function object, if it exists, has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }.
includes: [propertyHelper.js]
features: [Intl.Locale,Intl.Locale-info]
---*/
verifyProperty(Intl.Locale.prototype.getTextInfo, "name", {
value: "getTextInfo",
writable: false,
enumerable: false,
configurable: true,
});

View File

@ -2,19 +2,19 @@
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
esid: sec-intl.locale.prototype.textInfo esid: sec-intl.locale.prototype.getTextInfo
description: > description: >
Checks that the return value of Intl.Locale.prototype.textInfo is an Object Checks that the return value of Intl.Locale.prototype.getTextInfo is an Object
with the correct keys and properties. with the correct keys and properties.
info: | info: |
get Intl.Locale.prototype.textInfo get Intl.Locale.prototype.getTextInfo
... ...
7. Perform ! CreateDataPropertyOrThrow(info, "direction", dir). 7. Perform ! CreateDataPropertyOrThrow(info, "direction", dir).
features: [Intl.Locale,Intl.Locale-info] features: [Intl.Locale,Intl.Locale-info]
includes: [propertyHelper.js, compareArray.js] includes: [propertyHelper.js, compareArray.js]
---*/ ---*/
const result = new Intl.Locale('en').textInfo; const result = new Intl.Locale('en').getTextInfo();
assert.compareArray(Reflect.ownKeys(result), ['direction']); assert.compareArray(Reflect.ownKeys(result), ['direction']);
@ -24,7 +24,7 @@ verifyProperty(result, 'direction', {
configurable: true configurable: true
}); });
const direction = new Intl.Locale('en').textInfo.direction; const direction = new Intl.Locale('en').getTextInfo().direction;
assert( assert(
direction === 'rtl' || direction === 'ltr', direction === 'rtl' || direction === 'ltr',
'value of the `direction` property' 'value of the `direction` property'

View File

@ -0,0 +1,15 @@
// Copyright 2021 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-intl.locale.prototype.getTextInfo
description: >
Checks that the return value of Intl.Locale.prototype.getTextInfo is an Object.
info: |
get Intl.Locale.prototype.getTextInfo
...
5. Let info be ! ObjectCreate(%Object.prototype%).
features: [Intl.Locale,Intl.Locale-info]
---*/
assert.sameValue(Object.getPrototypeOf(new Intl.Locale('en').getTextInfo()), Object.prototype);

View File

@ -0,0 +1,25 @@
// Copyright 2023 Google Inc. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.Locale.prototype.getTextInfo
description: Checks the "getTextInfo" property of the Locale prototype object.
info: |
Intl.Locale.prototype.getTextInfo ()
Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 Language Specification, 10th edition, clause 17, or successor.
Every other data property described in clauses 18 through 26 and in Annex B.2 has the attributes { [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: true } unless otherwise specified.
includes: [propertyHelper.js]
features: [Intl.Locale,Intl.Locale-info]
---*/
assert.sameValue(
typeof Intl.Locale.prototype.getTextInfo,
"function",
"typeof Intl.Locale.prototype.getTextInfo is function"
);
verifyProperty(Intl.Locale.prototype, "getTextInfo", {
writable: true,
enumerable: false,
configurable: true,
});

View File

@ -0,0 +1,27 @@
// Copyright 2023 Google Inc. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.Locale.prototype.getTimeZones
description: Verifies the branding check for the "getTimeZones" function of the Locale prototype object.
info: |
Intl.Locale.prototype.getTimeZones ()
2. Perform ? RequireInternalSlot(loc, [[InitializedLocale]]).
features: [Intl.Locale,Intl.Locale-info]
---*/
const getTimeZones = Intl.Locale.prototype.getTimeZones;
assert.sameValue(typeof getTimeZones, "function");
assert.throws(TypeError, () => getTimeZones.call(undefined), "undefined");
assert.throws(TypeError, () => getTimeZones.call(null), "null");
assert.throws(TypeError, () => getTimeZones.call(true), "true");
assert.throws(TypeError, () => getTimeZones.call(""), "empty string");
assert.throws(TypeError, () => getTimeZones.call(Symbol()), "symbol");
assert.throws(TypeError, () => getTimeZones.call(1), "1");
assert.throws(TypeError, () => getTimeZones.call({}), "plain object");
assert.throws(TypeError, () => getTimeZones.call(Intl.Locale), "Intl.Locale");
assert.throws(TypeError, () => getTimeZones.call(Intl.Locale.prototype), "Intl.Locale.prototype");

View File

@ -0,0 +1,20 @@
// Copyright 2023 Google Inc. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.Locale.prototype.getTimeZones
description: Checks the "name" property of Intl.Locale.prototype.getTimeZones().
info: |
Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 Language Specification, 10th edition, clause 17, or successor.
Every built-in function object, including constructors, that is not identified as an anonymous function has a name property whose value is a String. Unless otherwise specified, this value is the name that is given to the function in this specification.
Unless otherwise specified, the name property of a built-in function object, if it exists, has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }.
includes: [propertyHelper.js]
features: [Intl.Locale,Intl.Locale-info]
---*/
verifyProperty(Intl.Locale.prototype.getTimeZones, "name", {
value: "getTimeZones",
writable: false,
enumerable: false,
configurable: true,
});

View File

@ -2,9 +2,9 @@
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
esid: sec-intl.locale.prototype.timeZones esid: sec-intl.locale.prototype.getTimeZones
description: > description: >
Checks that the return value of Intl.Locale.prototype.timeZones is a sorted Checks that the return value of Intl.Locale.prototype.getTimeZones is a sorted
Array. Array.
info: | info: |
TimeZonesOfLocale ( loc ) TimeZonesOfLocale ( loc )
@ -18,5 +18,5 @@ features: [Intl.Locale,Intl.Locale-info]
includes: [compareArray.js] includes: [compareArray.js]
---*/ ---*/
const output = new Intl.Locale('en-US').timeZones; const output = new Intl.Locale('en-US').getTimeZones();
assert.compareArray(output, [...output].sort()); assert.compareArray(output, [...output].sort());

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
esid: sec-intl.locale.prototype.timeZones esid: sec-intl.locale.prototype.getTimeZones
description: > description: >
Checks that the return value of Intl.Locale.prototype.timeZones is undefined Checks that the return value of Intl.Locale.prototype.timeZones is undefined
when no region subtag is used. when no region subtag is used.
@ -14,6 +14,4 @@ info: |
features: [Intl.Locale,Intl.Locale-info] features: [Intl.Locale,Intl.Locale-info]
---*/ ---*/
const propdesc = Object.getOwnPropertyDescriptor(Intl.Locale.prototype, "timeZones"); assert.sameValue(new Intl.Locale('en').getTimeZones(), undefined);
assert.sameValue(typeof propdesc.get, "function");
assert.sameValue(new Intl.Locale('en').timeZones, undefined);

View File

@ -2,9 +2,9 @@
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
esid: sec-intl.locale.prototype.timeZones esid: sec-intl.locale.prototype.getTimeZones
description: > description: >
Checks that the return value of Intl.Locale.prototype.timeZones is an Array Checks that the return value of Intl.Locale.prototype.getTimeZones is an Array
when a region subtag is used. when a region subtag is used.
info: | info: |
TimeZonesOfLocale ( loc ) TimeZonesOfLocale ( loc )
@ -13,5 +13,5 @@ info: |
features: [Intl.Locale,Intl.Locale-info] features: [Intl.Locale,Intl.Locale-info]
---*/ ---*/
assert(Array.isArray(new Intl.Locale('en-US').timeZones)); assert(Array.isArray(new Intl.Locale('en-US').getTimeZones()));
assert(new Intl.Locale('en-US').timeZones.length > 0, 'array has at least one element'); assert(new Intl.Locale('en-US').getTimeZones().length > 0, 'array has at least one element');

View File

@ -0,0 +1,25 @@
// Copyright 2023 Google Inc. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.Locale.prototype.getTimeZones
description: Checks the "getTimeZones" property of the Locale prototype object.
info: |
Intl.Locale.prototype.getTimeZones ()
Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 Language Specification, 10th edition, clause 17, or successor.
Every other data property described in clauses 18 through 26 and in Annex B.2 has the attributes { [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: true } unless otherwise specified.
includes: [propertyHelper.js]
features: [Intl.Locale,Intl.Locale-info]
---*/
assert.sameValue(
typeof Intl.Locale.prototype.getTimeZones,
"function",
"typeof Intl.Locale.prototype.getTimeZones is function"
);
verifyProperty(Intl.Locale.prototype, "getTimeZones", {
writable: true,
enumerable: false,
configurable: true,
});

View File

@ -0,0 +1,27 @@
// Copyright 2023 Google Inc. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.Locale.prototype.getWeekInfo
description: Verifies the branding check for the "getWeekInfo" function of the Locale prototype object.
info: |
Intl.Locale.prototype.getWeekInfo ()
2. Perform ? RequireInternalSlot(loc, [[InitializedLocale]]).
features: [Intl.Locale,Intl.Locale-info]
---*/
const getWeekInfo = Intl.Locale.prototype.getWeekInfo;
assert.sameValue(typeof getWeekInfo, "function");
assert.throws(TypeError, () => getWeekInfo.call(undefined), "undefined");
assert.throws(TypeError, () => getWeekInfo.call(null), "null");
assert.throws(TypeError, () => getWeekInfo.call(true), "true");
assert.throws(TypeError, () => getWeekInfo.call(""), "empty string");
assert.throws(TypeError, () => getWeekInfo.call(Symbol()), "symbol");
assert.throws(TypeError, () => getWeekInfo.call(1), "1");
assert.throws(TypeError, () => getWeekInfo.call({}), "plain object");
assert.throws(TypeError, () => getWeekInfo.call(Intl.Locale), "Intl.Locale");
assert.throws(TypeError, () => getWeekInfo.call(Intl.Locale.prototype), "Intl.Locale.prototype");

View File

@ -0,0 +1,20 @@
// Copyright 2023 Google Inc. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.Locale.prototype.getWeekInfo
description: Checks the "name" property of Intl.Locale.prototype.getWeekInfo().
info: |
Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 Language Specification, 10th edition, clause 17, or successor.
Every built-in function object, including constructors, that is not identified as an anonymous function has a name property whose value is a String. Unless otherwise specified, this value is the name that is given to the function in this specification.
Unless otherwise specified, the name property of a built-in function object, if it exists, has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }.
includes: [propertyHelper.js]
features: [Intl.Locale,Intl.Locale-info]
---*/
verifyProperty(Intl.Locale.prototype.getWeekInfo, "name", {
value: "getWeekInfo",
writable: false,
enumerable: false,
configurable: true,
});

View File

@ -3,19 +3,17 @@
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
esid: sec-intl.locale.prototype.weekInfo esid: sec-intl.locale.prototype.getWeekInfo
description: > description: >
Checks that the return value of Intl.Locale.prototype.weekInfo is an Object Checks that the return value of Intl.Locale.prototype.getWeekInfo is an Object
with the correct keys and properties. with the correct keys and properties.
info: | info: |
get Intl.Locale.prototype.weekInfo get Intl.Locale.prototype.getWeekInfo
... ...
7. Perform ! CreateDataPropertyOrThrow(info, "firstDay", wi.[[FirstDay]]). 6. Perform ! CreateDataPropertyOrThrow(info, "firstDay", wi.[[FirstDay]]).
8. Perform ! CreateDataPropertyOrThrow(info, "weekendStart", wi.[[WeekendStart]]). 7. Perform ! CreateDataPropertyOrThrow(info, "weekend", we).
9. Perform ! CreateDataPropertyOrThrow(info, "weekendEnd", wi.[[WeekendEnd]]). 8. Perform ! CreateDataPropertyOrThrow(info, "minimalDays", wi.[[MinimalDays]]).
10. Perform ! CreateDataPropertyOrThrow(info, "minimalDays", wi.[[MinimalDays]]).
... ...
CreateDataProperty ( O, P, V ) CreateDataProperty ( O, P, V )
... ...
3. Let newDesc be the PropertyDescriptor { [[Value]]: V, [[Writable]]: true, 3. Let newDesc be the PropertyDescriptor { [[Value]]: V, [[Writable]]: true,
@ -24,7 +22,7 @@ features: [Reflect,Intl.Locale,Intl.Locale-info]
includes: [propertyHelper.js, compareArray.js] includes: [propertyHelper.js, compareArray.js]
---*/ ---*/
const result = new Intl.Locale('en').weekInfo; const result = new Intl.Locale('en').getWeekInfo();
function isIntegerBetweenOneAndSeven(value) { function isIntegerBetweenOneAndSeven(value) {
return value === 1 || value === 2 || value === 3 || value === 4 || value === 5 || value === 6 || value === 7; return value === 1 || value === 2 || value === 3 || value === 4 || value === 5 || value === 6 || value === 7;
} }
@ -37,7 +35,7 @@ verifyProperty(result, 'firstDay', {
configurable: true configurable: true
}); });
assert( assert(
isIntegerBetweenOneAndSeven(new Intl.Locale('en').weekInfo.firstDay), isIntegerBetweenOneAndSeven(new Intl.Locale('en').getWeekInfo().firstDay),
'`firstDay` must be an integer between one and seven (inclusive)' '`firstDay` must be an integer between one and seven (inclusive)'
); );
@ -47,11 +45,11 @@ verifyProperty(result, 'weekend', {
configurable: true configurable: true
}); });
assert( assert(
new Intl.Locale('en').weekInfo.weekend.every(isIntegerBetweenOneAndSeven), new Intl.Locale('en').getWeekInfo().weekend.every(isIntegerBetweenOneAndSeven),
'`weekend` must include integers between one and seven (inclusive)' '`weekend` must include integers between one and seven (inclusive)'
); );
let original = new Intl.Locale('en').weekInfo.weekend; let original = new Intl.Locale('en').getWeekInfo().weekend;
let sorted = original.slice().sort(); let sorted = original.slice().sort();
assert.compareArray(original, sorted); assert.compareArray(original, sorted);
@ -61,6 +59,6 @@ verifyProperty(result, 'minimalDays', {
configurable: true configurable: true
}); });
assert( assert(
isIntegerBetweenOneAndSeven(new Intl.Locale('en').weekInfo.minimalDays), isIntegerBetweenOneAndSeven(new Intl.Locale('en').getWeekInfo().minimalDays),
'`minimalDays` must be an integer between one and seven (inclusive)' '`minimalDays` must be an integer between one and seven (inclusive)'
); );

View File

@ -0,0 +1,15 @@
// Copyright 2021 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-intl.locale.prototype.getWeekInfo
description: >
Checks that the return value of Intl.Locale.prototype.getWeekInfo is an Object.
info: |
get Intl.Locale.prototype.getWeekInfo
...
5. Let info be ! ObjectCreate(%Object.prototype%).
features: [Intl.Locale,Intl.Locale-info]
---*/
assert.sameValue(Object.getPrototypeOf(new Intl.Locale('en').getWeekInfo()), Object.prototype);

View File

@ -0,0 +1,25 @@
// Copyright 2023 Google Inc. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.Locale.prototype.getWeekInfo
description: Checks the "getWeekInfo" property of the Locale prototype object.
info: |
Intl.Locale.prototype.getWeekInfo ()
Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 Language Specification, 10th edition, clause 17, or successor.
Every other data property described in clauses 18 through 26 and in Annex B.2 has the attributes { [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: true } unless otherwise specified.
includes: [propertyHelper.js]
features: [Intl.Locale,Intl.Locale-info]
---*/
assert.sameValue(
typeof Intl.Locale.prototype.getWeekInfo,
"function",
"typeof Intl.Locale.prototype.getWeekInfo is function"
);
verifyProperty(Intl.Locale.prototype, "getWeekInfo", {
writable: true,
enumerable: false,
configurable: true,
});

View File

@ -1,31 +0,0 @@
// Copyright 2021 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.Locale.prototype.hourCycles
description: >
Verifies the branding check for the "hourCycles" property of the Locale prototype object.
info: |
Intl.Locale.prototype.hourCycles
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,Intl.Locale-info]
---*/
const propdesc = Object.getOwnPropertyDescriptor(Intl.Locale.prototype, "hourCycles");
assert.sameValue(typeof propdesc.get, "function");
const invalidValues = [
undefined,
null,
true,
"",
Symbol(),
1,
{},
Intl.Locale.prototype,
];
for (const invalidValue of invalidValues) {
assert.throws(TypeError, () => propdesc.get.call(invalidValue));
}

View File

@ -1,22 +0,0 @@
// Copyright 2021 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-intl.locale.prototype.hourCycles
description: >
Checks the "name" property of Intl.Locale.prototype.hourCycles.
info: |
Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 Language Specification, 10th edition, clause 17, or successor.
Every built-in function object, including constructors, that is not identified as an anonymous function has a name property whose value is a String. Unless otherwise specified, this value is the name that is given to the function in this specification. Functions that are specified as get or set accessor functions of built-in properties have "get " or "set " prepended to the property name string.
Unless otherwise specified, the name property of a built-in function object, if it exists, has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }.
includes: [propertyHelper.js]
features: [Intl.Locale,Intl.Locale-info]
---*/
const getter = Object.getOwnPropertyDescriptor(Intl.Locale.prototype, "hourCycles").get;
verifyProperty(getter, "name", {
value: "get hourCycles",
writable: false,
enumerable: false,
configurable: true,
});

View File

@ -1,25 +0,0 @@
// Copyright 2021 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-intl.locale
description: >
Checks the "hourCycles" property of the Locale prototype object.
info: |
Intl.Locale.prototype.hourCycles
Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 script Specification, 10th edition, clause 17, or successor.
Every accessor property described in clauses 18 through 26 and in Annex B.2 has the attributes { [[Enumerable]]: false, [[Configurable]]: true } unless otherwise specified. If only a get accessor function is described, the set accessor function is the default value, undefined.
includes: [propertyHelper.js]
features: [Intl.Locale,Intl.Locale-info]
---*/
const propdesc = Object.getOwnPropertyDescriptor(Intl.Locale.prototype, "hourCycles");
assert.sameValue(propdesc.set, undefined);
assert.sameValue(typeof propdesc.get, "function");
verifyProperty(Intl.Locale.prototype, "hourCycles", {
enumerable: false,
configurable: true,
});

View File

@ -1,31 +0,0 @@
// Copyright 2021 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.Locale.prototype.numberingSystems
description: >
Verifies the branding check for the "numberingSystems" property of the Locale prototype object.
info: |
Intl.Locale.prototype.numberingSystems
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,Intl.Locale-info]
---*/
const propdesc = Object.getOwnPropertyDescriptor(Intl.Locale.prototype, "numberingSystems");
assert.sameValue(typeof propdesc.get, "function");
const invalidValues = [
undefined,
null,
true,
"",
Symbol(),
1,
{},
Intl.Locale.prototype,
];
for (const invalidValue of invalidValues) {
assert.throws(TypeError, () => propdesc.get.call(invalidValue));
}

View File

@ -1,22 +0,0 @@
// Copyright 2021 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-intl.locale.prototype.numberingSystems
description: >
Checks the "name" property of Intl.Locale.prototype.numberingSystems.
info: |
Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 Language Specification, 10th edition, clause 17, or successor.
Every built-in function object, including constructors, that is not identified as an anonymous function has a name property whose value is a String. Unless otherwise specified, this value is the name that is given to the function in this specification. Functions that are specified as get or set accessor functions of built-in properties have "get " or "set " prepended to the property name string.
Unless otherwise specified, the name property of a built-in function object, if it exists, has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }.
includes: [propertyHelper.js]
features: [Intl.Locale,Intl.Locale-info]
---*/
const getter = Object.getOwnPropertyDescriptor(Intl.Locale.prototype, "numberingSystems").get;
verifyProperty(getter, "name", {
value: "get numberingSystems",
writable: false,
enumerable: false,
configurable: true,
});

View File

@ -1,16 +0,0 @@
// Copyright 2021 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-intl.locale.prototype.numberingSystems
description: >
Checks that the return value of Intl.Locale.prototype.numberingSystems is an Array.
info: |
NumberingSystemsOfLocale ( loc )
...
5. Return ! CreateArrayFromListAndPreferred( list, preferred ).
features: [Intl.Locale,Intl.Locale-info]
---*/
assert(Array.isArray(new Intl.Locale('en').numberingSystems));
assert(new Intl.Locale('en').numberingSystems.length > 0, 'array has at least one element');

View File

@ -1,25 +0,0 @@
// Copyright 2021 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-intl.locale
description: >
Checks the "numberingSystems" property of the Locale prototype object.
info: |
Intl.Locale.prototype.numberingSystems
Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 script Specification, 10th edition, clause 17, or successor.
Every accessor property described in clauses 18 through 26 and in Annex B.2 has the attributes { [[Enumerable]]: false, [[Configurable]]: true } unless otherwise specified. If only a get accessor function is described, the set accessor function is the default value, undefined.
includes: [propertyHelper.js]
features: [Intl.Locale,Intl.Locale-info]
---*/
const propdesc = Object.getOwnPropertyDescriptor(Intl.Locale.prototype, "numberingSystems");
assert.sameValue(propdesc.set, undefined);
assert.sameValue(typeof propdesc.get, "function");
verifyProperty(Intl.Locale.prototype, "numberingSystems", {
enumerable: false,
configurable: true,
});

View File

@ -1,31 +0,0 @@
// Copyright 2021 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.Locale.prototype.textInfo
description: >
Verifies the branding check for the "textInfo" property of the Locale prototype object.
info: |
Intl.Locale.prototype.textInfo
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,Intl.Locale-info]
---*/
const propdesc = Object.getOwnPropertyDescriptor(Intl.Locale.prototype, "textInfo");
assert.sameValue(typeof propdesc.get, "function");
const invalidValues = [
undefined,
null,
true,
"",
Symbol(),
1,
{},
Intl.Locale.prototype,
];
for (const invalidValue of invalidValues) {
assert.throws(TypeError, () => propdesc.get.call(invalidValue));
}

View File

@ -1,15 +0,0 @@
// Copyright 2021 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-intl.locale.prototype.textInfo
description: >
Checks that the return value of Intl.Locale.prototype.textInfo is an Object.
info: |
get Intl.Locale.prototype.textInfo
...
5. Let info be ! ObjectCreate(%Object.prototype%).
features: [Intl.Locale,Intl.Locale-info]
---*/
assert.sameValue(Object.getPrototypeOf(new Intl.Locale('en').textInfo), Object.prototype);

View File

@ -1,25 +0,0 @@
// Copyright 2021 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-intl.locale
description: >
Checks the "textInfo" property of the Locale prototype object.
info: |
Intl.Locale.prototype.textInfo
Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 script Specification, 10th edition, clause 17, or successor.
Every accessor property described in clauses 18 through 26 and in Annex B.2 has the attributes { [[Enumerable]]: false, [[Configurable]]: true } unless otherwise specified. If only a get accessor function is described, the set accessor function is the default value, undefined.
includes: [propertyHelper.js]
features: [Intl.Locale,Intl.Locale-info]
---*/
const propdesc = Object.getOwnPropertyDescriptor(Intl.Locale.prototype, "textInfo");
assert.sameValue(propdesc.set, undefined);
assert.sameValue(typeof propdesc.get, "function");
verifyProperty(Intl.Locale.prototype, "textInfo", {
enumerable: false,
configurable: true,
});

View File

@ -1,31 +0,0 @@
// Copyright 2021 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.Locale.prototype.timeZones
description: >
Verifies the branding check for the "timeZones" property of the Locale prototype object.
info: |
Intl.Locale.prototype.timeZones
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,Intl.Locale-info]
---*/
const propdesc = Object.getOwnPropertyDescriptor(Intl.Locale.prototype, "timeZones");
assert.sameValue(typeof propdesc.get, "function");
const invalidValues = [
undefined,
null,
true,
"",
Symbol(),
1,
{},
Intl.Locale.prototype,
];
for (const invalidValue of invalidValues) {
assert.throws(TypeError, () => propdesc.get.call(invalidValue));
}

View File

@ -1,25 +0,0 @@
// Copyright 2021 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-intl.locale
description: >
Checks the "timeZones" property of the Locale prototype object.
info: |
Intl.Locale.prototype.timeZones
Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 script Specification, 10th edition, clause 17, or successor.
Every accessor property described in clauses 18 through 26 and in Annex B.2 has the attributes { [[Enumerable]]: false, [[Configurable]]: true } unless otherwise specified. If only a get accessor function is described, the set accessor function is the default value, undefined.
includes: [propertyHelper.js]
features: [Intl.Locale,Intl.Locale-info]
---*/
const propdesc = Object.getOwnPropertyDescriptor(Intl.Locale.prototype, "timeZones");
assert.sameValue(propdesc.set, undefined);
assert.sameValue(typeof propdesc.get, "function");
verifyProperty(Intl.Locale.prototype, "timeZones", {
enumerable: false,
configurable: true,
});

View File

@ -1,31 +0,0 @@
// Copyright 2021 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.Locale.prototype.weekInfo
description: >
Verifies the branding check for the "weekInfo" property of the Locale prototype object.
info: |
Intl.Locale.prototype.weekInfo
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,Intl.Locale-info]
---*/
const propdesc = Object.getOwnPropertyDescriptor(Intl.Locale.prototype, "weekInfo");
assert.sameValue(typeof propdesc.get, "function");
const invalidValues = [
undefined,
null,
true,
"",
Symbol(),
1,
{},
Intl.Locale.prototype,
];
for (const invalidValue of invalidValues) {
assert.throws(TypeError, () => propdesc.get.call(invalidValue));
}

View File

@ -1,15 +0,0 @@
// Copyright 2021 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-intl.locale.prototype.weekInfo
description: >
Checks that the return value of Intl.Locale.prototype.weekInfo is an Object.
info: |
get Intl.Locale.prototype.weekInfo
...
5. Let info be ! ObjectCreate(%Object.prototype%).
features: [Intl.Locale,Intl.Locale-info]
---*/
assert.sameValue(Object.getPrototypeOf(new Intl.Locale('en').weekInfo), Object.prototype);

View File

@ -1,25 +0,0 @@
// Copyright 2021 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-intl.locale
description: >
Checks the "weekInfo" property of the Locale prototype object.
info: |
Intl.Locale.prototype.weekInfo
Unless specified otherwise in this document, the objects, functions, and constructors described in this standard are subject to the generic requirements and restrictions specified for standard built-in ECMAScript objects in the ECMAScript 2019 script Specification, 10th edition, clause 17, or successor.
Every accessor property described in clauses 18 through 26 and in Annex B.2 has the attributes { [[Enumerable]]: false, [[Configurable]]: true } unless otherwise specified. If only a get accessor function is described, the set accessor function is the default value, undefined.
includes: [propertyHelper.js]
features: [Intl.Locale,Intl.Locale-info]
---*/
const propdesc = Object.getOwnPropertyDescriptor(Intl.Locale.prototype, "weekInfo");
assert.sameValue(propdesc.set, undefined);
assert.sameValue(typeof propdesc.get, "function");
verifyProperty(Intl.Locale.prototype, "weekInfo", {
enumerable: false,
configurable: true,
});