diff --git a/test/intl402/Locale/prototype/calendars/branding.js b/test/intl402/Locale/prototype/calendars/branding.js deleted file mode 100644 index 9cebc88fb5..0000000000 --- a/test/intl402/Locale/prototype/calendars/branding.js +++ /dev/null @@ -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)); -} diff --git a/test/intl402/Locale/prototype/calendars/prop-desc.js b/test/intl402/Locale/prototype/calendars/prop-desc.js deleted file mode 100644 index 5831f75db7..0000000000 --- a/test/intl402/Locale/prototype/calendars/prop-desc.js +++ /dev/null @@ -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, -}); diff --git a/test/intl402/Locale/prototype/collations/branding.js b/test/intl402/Locale/prototype/collations/branding.js deleted file mode 100644 index 4bbe405161..0000000000 --- a/test/intl402/Locale/prototype/collations/branding.js +++ /dev/null @@ -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)); -} diff --git a/test/intl402/Locale/prototype/collations/name.js b/test/intl402/Locale/prototype/collations/name.js deleted file mode 100644 index a1d16888ac..0000000000 --- a/test/intl402/Locale/prototype/collations/name.js +++ /dev/null @@ -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, -}); diff --git a/test/intl402/Locale/prototype/collations/prop-desc.js b/test/intl402/Locale/prototype/collations/prop-desc.js deleted file mode 100644 index d081bdfb26..0000000000 --- a/test/intl402/Locale/prototype/collations/prop-desc.js +++ /dev/null @@ -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, -}); diff --git a/test/intl402/Locale/prototype/getCalendars/branding.js b/test/intl402/Locale/prototype/getCalendars/branding.js new file mode 100644 index 0000000000..05fcf2d7f4 --- /dev/null +++ b/test/intl402/Locale/prototype/getCalendars/branding.js @@ -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"); diff --git a/test/intl402/Locale/prototype/weekInfo/name.js b/test/intl402/Locale/prototype/getCalendars/name.js similarity index 67% rename from test/intl402/Locale/prototype/weekInfo/name.js rename to test/intl402/Locale/prototype/getCalendars/name.js index c5a4974bee..0f767b8b72 100644 --- a/test/intl402/Locale/prototype/weekInfo/name.js +++ b/test/intl402/Locale/prototype/getCalendars/name.js @@ -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. /*--- -esid: sec-intl.locale.prototype.weekInfo -description: > - Checks the "name" property of Intl.Locale.prototype.weekInfo. +esid: sec-Intl.Locale.prototype.getCalendars +description: Checks the "name" property of Intl.Locale.prototype.getCalendars(). 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. + 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] ---*/ -const getter = Object.getOwnPropertyDescriptor(Intl.Locale.prototype, "weekInfo").get; -verifyProperty(getter, "name", { - value: "get weekInfo", +verifyProperty(Intl.Locale.prototype.getCalendars, "name", { + value: "getCalendars", writable: false, enumerable: false, configurable: true, diff --git a/test/intl402/Locale/prototype/calendars/output-array.js b/test/intl402/Locale/prototype/getCalendars/output-array.js similarity index 51% rename from test/intl402/Locale/prototype/calendars/output-array.js rename to test/intl402/Locale/prototype/getCalendars/output-array.js index 4f7585c4fe..fbcd98a725 100644 --- a/test/intl402/Locale/prototype/calendars/output-array.js +++ b/test/intl402/Locale/prototype/getCalendars/output-array.js @@ -2,9 +2,9 @@ // 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: > - 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: | CalendarsOfLocale ( loc ) ... @@ -12,5 +12,5 @@ info: | features: [Intl.Locale,Intl.Locale-info] ---*/ -assert(Array.isArray(new Intl.Locale('en').calendars)); -assert(new Intl.Locale('en').calendars.length > 0, 'array has at least one element'); +assert(Array.isArray(new Intl.Locale('en').getCalendars())); +assert(new Intl.Locale('en').getCalendars().length > 0, 'array has at least one element'); diff --git a/test/intl402/Locale/prototype/getCalendars/prop-desc.js b/test/intl402/Locale/prototype/getCalendars/prop-desc.js new file mode 100644 index 0000000000..fc56a6bf84 --- /dev/null +++ b/test/intl402/Locale/prototype/getCalendars/prop-desc.js @@ -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, +}); diff --git a/test/intl402/Locale/prototype/getCollations/branding.js b/test/intl402/Locale/prototype/getCollations/branding.js new file mode 100644 index 0000000000..d3a638c10f --- /dev/null +++ b/test/intl402/Locale/prototype/getCollations/branding.js @@ -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"); diff --git a/test/intl402/Locale/prototype/textInfo/name.js b/test/intl402/Locale/prototype/getCollations/name.js similarity index 67% rename from test/intl402/Locale/prototype/textInfo/name.js rename to test/intl402/Locale/prototype/getCollations/name.js index 876ffcc56a..939cc146e4 100644 --- a/test/intl402/Locale/prototype/textInfo/name.js +++ b/test/intl402/Locale/prototype/getCollations/name.js @@ -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. /*--- -esid: sec-intl.locale.prototype.textInfo -description: > - Checks the "name" property of Intl.Locale.prototype.textInfo. +esid: sec-Intl.Locale.prototype.getCollations +description: Checks the "name" property of Intl.Locale.prototype.getCollations(). 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. + 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] ---*/ -const getter = Object.getOwnPropertyDescriptor(Intl.Locale.prototype, "textInfo").get; -verifyProperty(getter, "name", { - value: "get textInfo", +verifyProperty(Intl.Locale.prototype.getCollations, "name", { + value: "getCollations", writable: false, enumerable: false, configurable: true, diff --git a/test/intl402/Locale/prototype/collations/output-array-values.js b/test/intl402/Locale/prototype/getCollations/output-array-values.js similarity index 94% rename from test/intl402/Locale/prototype/collations/output-array-values.js rename to test/intl402/Locale/prototype/getCollations/output-array-values.js index 7f1656d528..119f79617c 100644 --- a/test/intl402/Locale/prototype/collations/output-array-values.js +++ b/test/intl402/Locale/prototype/getCollations/output-array-values.js @@ -17,7 +17,7 @@ info: | 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'); output.forEach(c => { if(['standard', 'search'].includes(c)) diff --git a/test/intl402/Locale/prototype/collations/output-array.js b/test/intl402/Locale/prototype/getCollations/output-array.js similarity index 61% rename from test/intl402/Locale/prototype/collations/output-array.js rename to test/intl402/Locale/prototype/getCollations/output-array.js index 0e9d66932c..e18d58da29 100644 --- a/test/intl402/Locale/prototype/collations/output-array.js +++ b/test/intl402/Locale/prototype/getCollations/output-array.js @@ -2,9 +2,9 @@ // 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: > - 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: | CollationsOfLocale ( loc ) ... @@ -12,4 +12,4 @@ info: | features: [Intl.Locale,Intl.Locale-info] ---*/ -assert(Array.isArray(new Intl.Locale('en').collations)); +assert(Array.isArray(new Intl.Locale('en').getCollations())); diff --git a/test/intl402/Locale/prototype/getCollations/prop-desc.js b/test/intl402/Locale/prototype/getCollations/prop-desc.js new file mode 100644 index 0000000000..be314a45e9 --- /dev/null +++ b/test/intl402/Locale/prototype/getCollations/prop-desc.js @@ -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, +}); diff --git a/test/intl402/Locale/prototype/getHourCycles/branding.js b/test/intl402/Locale/prototype/getHourCycles/branding.js new file mode 100644 index 0000000000..9fd19201a8 --- /dev/null +++ b/test/intl402/Locale/prototype/getHourCycles/branding.js @@ -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"); diff --git a/test/intl402/Locale/prototype/timeZones/name.js b/test/intl402/Locale/prototype/getHourCycles/name.js similarity index 67% rename from test/intl402/Locale/prototype/timeZones/name.js rename to test/intl402/Locale/prototype/getHourCycles/name.js index 14156aff06..54d29cb221 100644 --- a/test/intl402/Locale/prototype/timeZones/name.js +++ b/test/intl402/Locale/prototype/getHourCycles/name.js @@ -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. /*--- -esid: sec-intl.locale.prototype.timeZones -description: > - Checks the "name" property of Intl.Locale.prototype.timeZones. +esid: sec-Intl.Locale.prototype.getHourCycles +description: Checks the "name" property of Intl.Locale.prototype.getHourCycles(). 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. + 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] ---*/ -const getter = Object.getOwnPropertyDescriptor(Intl.Locale.prototype, "timeZones").get; -verifyProperty(getter, "name", { - value: "get timeZones", +verifyProperty(Intl.Locale.prototype.getHourCycles, "name", { + value: "getHourCycles", writable: false, enumerable: false, configurable: true, diff --git a/test/intl402/Locale/prototype/hourCycles/output-array-values.js b/test/intl402/Locale/prototype/getHourCycles/output-array-values.js similarity index 80% rename from test/intl402/Locale/prototype/hourCycles/output-array-values.js rename to test/intl402/Locale/prototype/getHourCycles/output-array-values.js index 3d7976a964..60e2566a6d 100644 --- a/test/intl402/Locale/prototype/hourCycles/output-array-values.js +++ b/test/intl402/Locale/prototype/getHourCycles/output-array-values.js @@ -2,9 +2,9 @@ // 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: > - 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. info: | HourCyclesOfLocale ( loc ) @@ -16,7 +16,7 @@ info: | 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'); output.forEach(hc => { if(!['h11', 'h12', 'h23', 'h24'].includes(hc)) diff --git a/test/intl402/Locale/prototype/hourCycles/output-array.js b/test/intl402/Locale/prototype/getHourCycles/output-array.js similarity index 61% rename from test/intl402/Locale/prototype/hourCycles/output-array.js rename to test/intl402/Locale/prototype/getHourCycles/output-array.js index c55b774c80..42b51ba250 100644 --- a/test/intl402/Locale/prototype/hourCycles/output-array.js +++ b/test/intl402/Locale/prototype/getHourCycles/output-array.js @@ -2,9 +2,9 @@ // 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: > - 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: | HourCyclesOfLocale ( loc ) ... @@ -12,4 +12,4 @@ info: | features: [Intl.Locale,Intl.Locale-info] ---*/ -assert(Array.isArray(new Intl.Locale('en').hourCycles)); +assert(Array.isArray(new Intl.Locale('en').getHourCycles())); diff --git a/test/intl402/Locale/prototype/getHourCycles/prop-desc.js b/test/intl402/Locale/prototype/getHourCycles/prop-desc.js new file mode 100644 index 0000000000..7f80044cb3 --- /dev/null +++ b/test/intl402/Locale/prototype/getHourCycles/prop-desc.js @@ -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, +}); diff --git a/test/intl402/Locale/prototype/getNumberingSystems/branding.js b/test/intl402/Locale/prototype/getNumberingSystems/branding.js new file mode 100644 index 0000000000..5e58171d45 --- /dev/null +++ b/test/intl402/Locale/prototype/getNumberingSystems/branding.js @@ -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"); diff --git a/test/intl402/Locale/prototype/calendars/name.js b/test/intl402/Locale/prototype/getNumberingSystems/name.js similarity index 67% rename from test/intl402/Locale/prototype/calendars/name.js rename to test/intl402/Locale/prototype/getNumberingSystems/name.js index 8a23127e3a..4207c54ae8 100644 --- a/test/intl402/Locale/prototype/calendars/name.js +++ b/test/intl402/Locale/prototype/getNumberingSystems/name.js @@ -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. /*--- -esid: sec-intl.locale.prototype.calendars -description: > - Checks the "name" property of Intl.Locale.prototype.calendars. +esid: sec-Intl.Locale.prototype.getNumberingSystems +description: Checks the "name" property of Intl.Locale.prototype.getNumberingSystems(). 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. + 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] ---*/ -const getter = Object.getOwnPropertyDescriptor(Intl.Locale.prototype, "calendars").get; -verifyProperty(getter, "name", { - value: "get calendars", +verifyProperty(Intl.Locale.prototype.getNumberingSystems, "name", { + value: "getNumberingSystems", writable: false, enumerable: false, configurable: true, diff --git a/test/intl402/Locale/prototype/getNumberingSystems/output-array.js b/test/intl402/Locale/prototype/getNumberingSystems/output-array.js new file mode 100644 index 0000000000..c51001f6dd --- /dev/null +++ b/test/intl402/Locale/prototype/getNumberingSystems/output-array.js @@ -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'); diff --git a/test/intl402/Locale/prototype/getNumberingSystems/prop-desc.js b/test/intl402/Locale/prototype/getNumberingSystems/prop-desc.js new file mode 100644 index 0000000000..16d6cd3a99 --- /dev/null +++ b/test/intl402/Locale/prototype/getNumberingSystems/prop-desc.js @@ -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, +}); diff --git a/test/intl402/Locale/prototype/getTextInfo/branding.js b/test/intl402/Locale/prototype/getTextInfo/branding.js new file mode 100644 index 0000000000..9b3d722891 --- /dev/null +++ b/test/intl402/Locale/prototype/getTextInfo/branding.js @@ -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"); diff --git a/test/intl402/Locale/prototype/getTextInfo/name.js b/test/intl402/Locale/prototype/getTextInfo/name.js new file mode 100644 index 0000000000..4b9e5fc37f --- /dev/null +++ b/test/intl402/Locale/prototype/getTextInfo/name.js @@ -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, +}); diff --git a/test/intl402/Locale/prototype/textInfo/output-object-keys.js b/test/intl402/Locale/prototype/getTextInfo/output-object-keys.js similarity index 68% rename from test/intl402/Locale/prototype/textInfo/output-object-keys.js rename to test/intl402/Locale/prototype/getTextInfo/output-object-keys.js index 38b2d9bc8b..85f5cf9a02 100644 --- a/test/intl402/Locale/prototype/textInfo/output-object-keys.js +++ b/test/intl402/Locale/prototype/getTextInfo/output-object-keys.js @@ -2,19 +2,19 @@ // 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: > - 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. info: | - get Intl.Locale.prototype.textInfo + get Intl.Locale.prototype.getTextInfo ... 7. Perform ! CreateDataPropertyOrThrow(info, "direction", dir). features: [Intl.Locale,Intl.Locale-info] 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']); @@ -24,7 +24,7 @@ verifyProperty(result, 'direction', { configurable: true }); -const direction = new Intl.Locale('en').textInfo.direction; +const direction = new Intl.Locale('en').getTextInfo().direction; assert( direction === 'rtl' || direction === 'ltr', 'value of the `direction` property' diff --git a/test/intl402/Locale/prototype/getTextInfo/output-object.js b/test/intl402/Locale/prototype/getTextInfo/output-object.js new file mode 100644 index 0000000000..ebd6367758 --- /dev/null +++ b/test/intl402/Locale/prototype/getTextInfo/output-object.js @@ -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); diff --git a/test/intl402/Locale/prototype/getTextInfo/prop-desc.js b/test/intl402/Locale/prototype/getTextInfo/prop-desc.js new file mode 100644 index 0000000000..279bd4511c --- /dev/null +++ b/test/intl402/Locale/prototype/getTextInfo/prop-desc.js @@ -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, +}); diff --git a/test/intl402/Locale/prototype/getTimeZones/branding.js b/test/intl402/Locale/prototype/getTimeZones/branding.js new file mode 100644 index 0000000000..e714dcbac5 --- /dev/null +++ b/test/intl402/Locale/prototype/getTimeZones/branding.js @@ -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"); diff --git a/test/intl402/Locale/prototype/getTimeZones/name.js b/test/intl402/Locale/prototype/getTimeZones/name.js new file mode 100644 index 0000000000..e471e6ef34 --- /dev/null +++ b/test/intl402/Locale/prototype/getTimeZones/name.js @@ -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, +}); diff --git a/test/intl402/Locale/prototype/timeZones/output-array-sorted.js b/test/intl402/Locale/prototype/getTimeZones/output-array-sorted.js similarity index 77% rename from test/intl402/Locale/prototype/timeZones/output-array-sorted.js rename to test/intl402/Locale/prototype/getTimeZones/output-array-sorted.js index ae498cfeb3..a152cb4f4f 100644 --- a/test/intl402/Locale/prototype/timeZones/output-array-sorted.js +++ b/test/intl402/Locale/prototype/getTimeZones/output-array-sorted.js @@ -2,9 +2,9 @@ // 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: > - 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. info: | TimeZonesOfLocale ( loc ) @@ -18,5 +18,5 @@ features: [Intl.Locale,Intl.Locale-info] includes: [compareArray.js] ---*/ -const output = new Intl.Locale('en-US').timeZones; +const output = new Intl.Locale('en-US').getTimeZones(); assert.compareArray(output, [...output].sort()); diff --git a/test/intl402/Locale/prototype/timeZones/output-undefined.js b/test/intl402/Locale/prototype/getTimeZones/output-array-undefined.js similarity index 67% rename from test/intl402/Locale/prototype/timeZones/output-undefined.js rename to test/intl402/Locale/prototype/getTimeZones/output-array-undefined.js index 01e7717b1a..2760e073e3 100644 --- a/test/intl402/Locale/prototype/timeZones/output-undefined.js +++ b/test/intl402/Locale/prototype/getTimeZones/output-array-undefined.js @@ -2,7 +2,7 @@ // 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: > Checks that the return value of Intl.Locale.prototype.timeZones is undefined when no region subtag is used. @@ -14,6 +14,4 @@ info: | features: [Intl.Locale,Intl.Locale-info] ---*/ -const propdesc = Object.getOwnPropertyDescriptor(Intl.Locale.prototype, "timeZones"); -assert.sameValue(typeof propdesc.get, "function"); -assert.sameValue(new Intl.Locale('en').timeZones, undefined); +assert.sameValue(new Intl.Locale('en').getTimeZones(), undefined); diff --git a/test/intl402/Locale/prototype/timeZones/output-array.js b/test/intl402/Locale/prototype/getTimeZones/output-array.js similarity index 53% rename from test/intl402/Locale/prototype/timeZones/output-array.js rename to test/intl402/Locale/prototype/getTimeZones/output-array.js index 41ef4d527b..98ed1b0f31 100644 --- a/test/intl402/Locale/prototype/timeZones/output-array.js +++ b/test/intl402/Locale/prototype/getTimeZones/output-array.js @@ -2,9 +2,9 @@ // 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: > - 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. info: | TimeZonesOfLocale ( loc ) @@ -13,5 +13,5 @@ info: | features: [Intl.Locale,Intl.Locale-info] ---*/ -assert(Array.isArray(new Intl.Locale('en-US').timeZones)); -assert(new Intl.Locale('en-US').timeZones.length > 0, 'array has at least one element'); +assert(Array.isArray(new Intl.Locale('en-US').getTimeZones())); +assert(new Intl.Locale('en-US').getTimeZones().length > 0, 'array has at least one element'); diff --git a/test/intl402/Locale/prototype/getTimeZones/prop-desc.js b/test/intl402/Locale/prototype/getTimeZones/prop-desc.js new file mode 100644 index 0000000000..50c6e7cf65 --- /dev/null +++ b/test/intl402/Locale/prototype/getTimeZones/prop-desc.js @@ -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, +}); diff --git a/test/intl402/Locale/prototype/getWeekInfo/branding.js b/test/intl402/Locale/prototype/getWeekInfo/branding.js new file mode 100644 index 0000000000..5bf0d72576 --- /dev/null +++ b/test/intl402/Locale/prototype/getWeekInfo/branding.js @@ -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"); diff --git a/test/intl402/Locale/prototype/getWeekInfo/name.js b/test/intl402/Locale/prototype/getWeekInfo/name.js new file mode 100644 index 0000000000..8ff77fc0b8 --- /dev/null +++ b/test/intl402/Locale/prototype/getWeekInfo/name.js @@ -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, +}); diff --git a/test/intl402/Locale/prototype/weekInfo/output-object-keys.js b/test/intl402/Locale/prototype/getWeekInfo/output-object-keys.js similarity index 63% rename from test/intl402/Locale/prototype/weekInfo/output-object-keys.js rename to test/intl402/Locale/prototype/getWeekInfo/output-object-keys.js index 3df6e59207..181170985c 100644 --- a/test/intl402/Locale/prototype/weekInfo/output-object-keys.js +++ b/test/intl402/Locale/prototype/getWeekInfo/output-object-keys.js @@ -3,19 +3,17 @@ // 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: > - 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. info: | - get Intl.Locale.prototype.weekInfo + get Intl.Locale.prototype.getWeekInfo ... - 7. Perform ! CreateDataPropertyOrThrow(info, "firstDay", wi.[[FirstDay]]). - 8. Perform ! CreateDataPropertyOrThrow(info, "weekendStart", wi.[[WeekendStart]]). - 9. Perform ! CreateDataPropertyOrThrow(info, "weekendEnd", wi.[[WeekendEnd]]). - 10. Perform ! CreateDataPropertyOrThrow(info, "minimalDays", wi.[[MinimalDays]]). + 6. Perform ! CreateDataPropertyOrThrow(info, "firstDay", wi.[[FirstDay]]). + 7. Perform ! CreateDataPropertyOrThrow(info, "weekend", we). + 8. Perform ! CreateDataPropertyOrThrow(info, "minimalDays", wi.[[MinimalDays]]). ... - CreateDataProperty ( O, P, V ) ... 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] ---*/ -const result = new Intl.Locale('en').weekInfo; +const result = new Intl.Locale('en').getWeekInfo(); function isIntegerBetweenOneAndSeven(value) { return value === 1 || value === 2 || value === 3 || value === 4 || value === 5 || value === 6 || value === 7; } @@ -37,7 +35,7 @@ verifyProperty(result, 'firstDay', { configurable: true }); 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)' ); @@ -47,11 +45,11 @@ verifyProperty(result, 'weekend', { configurable: true }); 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)' ); -let original = new Intl.Locale('en').weekInfo.weekend; +let original = new Intl.Locale('en').getWeekInfo().weekend; let sorted = original.slice().sort(); assert.compareArray(original, sorted); @@ -61,6 +59,6 @@ verifyProperty(result, 'minimalDays', { configurable: true }); 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)' ); diff --git a/test/intl402/Locale/prototype/getWeekInfo/output-object.js b/test/intl402/Locale/prototype/getWeekInfo/output-object.js new file mode 100644 index 0000000000..6db95e14e5 --- /dev/null +++ b/test/intl402/Locale/prototype/getWeekInfo/output-object.js @@ -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); diff --git a/test/intl402/Locale/prototype/getWeekInfo/prop-desc.js b/test/intl402/Locale/prototype/getWeekInfo/prop-desc.js new file mode 100644 index 0000000000..d954183cd1 --- /dev/null +++ b/test/intl402/Locale/prototype/getWeekInfo/prop-desc.js @@ -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, +}); diff --git a/test/intl402/Locale/prototype/hourCycles/branding.js b/test/intl402/Locale/prototype/hourCycles/branding.js deleted file mode 100644 index 9135f7ef95..0000000000 --- a/test/intl402/Locale/prototype/hourCycles/branding.js +++ /dev/null @@ -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)); -} diff --git a/test/intl402/Locale/prototype/hourCycles/name.js b/test/intl402/Locale/prototype/hourCycles/name.js deleted file mode 100644 index bdede974ae..0000000000 --- a/test/intl402/Locale/prototype/hourCycles/name.js +++ /dev/null @@ -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, -}); diff --git a/test/intl402/Locale/prototype/hourCycles/prop-desc.js b/test/intl402/Locale/prototype/hourCycles/prop-desc.js deleted file mode 100644 index 31b108e17a..0000000000 --- a/test/intl402/Locale/prototype/hourCycles/prop-desc.js +++ /dev/null @@ -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, -}); diff --git a/test/intl402/Locale/prototype/numberingSystems/branding.js b/test/intl402/Locale/prototype/numberingSystems/branding.js deleted file mode 100644 index e2a76940b8..0000000000 --- a/test/intl402/Locale/prototype/numberingSystems/branding.js +++ /dev/null @@ -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)); -} diff --git a/test/intl402/Locale/prototype/numberingSystems/name.js b/test/intl402/Locale/prototype/numberingSystems/name.js deleted file mode 100644 index c78aeaa788..0000000000 --- a/test/intl402/Locale/prototype/numberingSystems/name.js +++ /dev/null @@ -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, -}); diff --git a/test/intl402/Locale/prototype/numberingSystems/output-array.js b/test/intl402/Locale/prototype/numberingSystems/output-array.js deleted file mode 100644 index d26e2b4737..0000000000 --- a/test/intl402/Locale/prototype/numberingSystems/output-array.js +++ /dev/null @@ -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'); diff --git a/test/intl402/Locale/prototype/numberingSystems/prop-desc.js b/test/intl402/Locale/prototype/numberingSystems/prop-desc.js deleted file mode 100644 index c9f3180189..0000000000 --- a/test/intl402/Locale/prototype/numberingSystems/prop-desc.js +++ /dev/null @@ -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, -}); diff --git a/test/intl402/Locale/prototype/textInfo/branding.js b/test/intl402/Locale/prototype/textInfo/branding.js deleted file mode 100644 index 2837a42049..0000000000 --- a/test/intl402/Locale/prototype/textInfo/branding.js +++ /dev/null @@ -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)); -} diff --git a/test/intl402/Locale/prototype/textInfo/output-object.js b/test/intl402/Locale/prototype/textInfo/output-object.js deleted file mode 100644 index 8d6b12ac9d..0000000000 --- a/test/intl402/Locale/prototype/textInfo/output-object.js +++ /dev/null @@ -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); diff --git a/test/intl402/Locale/prototype/textInfo/prop-desc.js b/test/intl402/Locale/prototype/textInfo/prop-desc.js deleted file mode 100644 index 4862fd558a..0000000000 --- a/test/intl402/Locale/prototype/textInfo/prop-desc.js +++ /dev/null @@ -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, -}); diff --git a/test/intl402/Locale/prototype/timeZones/branding.js b/test/intl402/Locale/prototype/timeZones/branding.js deleted file mode 100644 index 85110e22ab..0000000000 --- a/test/intl402/Locale/prototype/timeZones/branding.js +++ /dev/null @@ -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)); -} diff --git a/test/intl402/Locale/prototype/timeZones/prop-desc.js b/test/intl402/Locale/prototype/timeZones/prop-desc.js deleted file mode 100644 index e11ca93394..0000000000 --- a/test/intl402/Locale/prototype/timeZones/prop-desc.js +++ /dev/null @@ -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, -}); diff --git a/test/intl402/Locale/prototype/weekInfo/branding.js b/test/intl402/Locale/prototype/weekInfo/branding.js deleted file mode 100644 index 4cba59b289..0000000000 --- a/test/intl402/Locale/prototype/weekInfo/branding.js +++ /dev/null @@ -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)); -} diff --git a/test/intl402/Locale/prototype/weekInfo/output-object.js b/test/intl402/Locale/prototype/weekInfo/output-object.js deleted file mode 100644 index 0f1f7eaed1..0000000000 --- a/test/intl402/Locale/prototype/weekInfo/output-object.js +++ /dev/null @@ -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); diff --git a/test/intl402/Locale/prototype/weekInfo/prop-desc.js b/test/intl402/Locale/prototype/weekInfo/prop-desc.js deleted file mode 100644 index 188aa0b7a4..0000000000 --- a/test/intl402/Locale/prototype/weekInfo/prop-desc.js +++ /dev/null @@ -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, -});