Skip to content
Snippets Groups Projects
Commit fbccd8ee authored by Rick Waldron's avatar Rick Waldron
Browse files

Intl: PluralRules, NumberFormat, Number & getCanonicalLocales to use verifyProperty

There's a lot of work like this to do, but not enough time in the day to reach it all.
parent 50de5f98
No related branches found
No related tags found
No related merge requests found
...@@ -15,6 +15,8 @@ info: | ...@@ -15,6 +15,8 @@ info: |
includes: [propertyHelper.js] includes: [propertyHelper.js]
---*/ ---*/
verifyNotEnumerable(Intl, "getCanonicalLocales"); verifyProperty(Intl, 'getCanonicalLocales', {
verifyWritable(Intl, "getCanonicalLocales"); writable: true,
verifyConfigurable(Intl, "getCanonicalLocales"); enumerable: false,
configurable: true,
});
...@@ -15,5 +15,5 @@ assert(compareArray( ...@@ -15,5 +15,5 @@ assert(compareArray(
Intl.getCanonicalLocales( Intl.getCanonicalLocales(
['ab-cd', 'ff', 'de-rt', 'ab-Cd']), ['ab-CD', 'ff', 'de-RT'])); ['ab-cd', 'ff', 'de-rt', 'ab-Cd']), ['ab-CD', 'ff', 'de-RT']));
var locales = Intl.getCanonicalLocales(["en-US", "en-US"]); var locales = Intl.getCanonicalLocales(['en-US', 'en-US']);
assert(compareArray(locales, ['en-US']), 'en-US'); assert(compareArray(locales, ['en-US']), 'en-US');
...@@ -24,8 +24,9 @@ info: | ...@@ -24,8 +24,9 @@ info: |
includes: [propertyHelper.js] includes: [propertyHelper.js]
---*/ ---*/
assert.sameValue(Number.prototype.toLocaleString.length, 0); verifyProperty(Number.prototype.toLocaleString, 'length', {
value: 0,
verifyNotEnumerable(Number.prototype.toLocaleString, "length"); writable: false,
verifyNotWritable(Number.prototype.toLocaleString, "length"); enumerable: false,
verifyConfigurable(Number.prototype.toLocaleString, "length"); configurable: true
});
...@@ -29,3 +29,10 @@ assert.sameValue(Intl.NumberFormat.length, 0); ...@@ -29,3 +29,10 @@ assert.sameValue(Intl.NumberFormat.length, 0);
verifyNotEnumerable(Intl.NumberFormat, "length"); verifyNotEnumerable(Intl.NumberFormat, "length");
verifyNotWritable(Intl.NumberFormat, "length"); verifyNotWritable(Intl.NumberFormat, "length");
verifyConfigurable(Intl.NumberFormat, "length"); verifyConfigurable(Intl.NumberFormat, "length");
verifyProperty(Intl.NumberFormat, 'length', {
value: 0,
writable: false,
enumerable: false,
configurable: true
});
...@@ -19,8 +19,9 @@ info: | ...@@ -19,8 +19,9 @@ info: |
includes: [propertyHelper.js] includes: [propertyHelper.js]
---*/ ---*/
assert.sameValue(Intl.NumberFormat.name, "NumberFormat"); verifyProperty(Intl.NumberFormat, 'name', {
value: 'NumberFormat',
verifyNotEnumerable(Intl.NumberFormat, "name"); writable: false,
verifyNotWritable(Intl.NumberFormat, "name"); enumerable: false,
verifyConfigurable(Intl.NumberFormat, "name"); configurable: true
});
...@@ -24,6 +24,8 @@ info: | ...@@ -24,6 +24,8 @@ info: |
includes: [propertyHelper.js] includes: [propertyHelper.js]
---*/ ---*/
verifyNotEnumerable(Intl, "NumberFormat"); verifyProperty(Intl, 'NumberFormat', {
verifyWritable(Intl, "NumberFormat"); writable: true,
verifyConfigurable(Intl, "NumberFormat"); enumerable: false,
configurable: true
});
...@@ -8,8 +8,9 @@ author: Zibi Braniecki ...@@ -8,8 +8,9 @@ author: Zibi Braniecki
includes: [propertyHelper.js] includes: [propertyHelper.js]
---*/ ---*/
assert.sameValue(Intl.PluralRules.length, 0); verifyProperty(Intl.PluralRules, 'length', {
value: 0,
verifyNotEnumerable(Intl.PluralRules, "length"); writable: false,
verifyNotWritable(Intl.PluralRules, "length"); enumerable: false,
verifyConfigurable(Intl.PluralRules, "length"); configurable: true
});
...@@ -8,8 +8,9 @@ author: Zibi Braniecki ...@@ -8,8 +8,9 @@ author: Zibi Braniecki
includes: [propertyHelper.js] includes: [propertyHelper.js]
---*/ ---*/
assert.sameValue(Intl.PluralRules.name, "PluralRules"); verifyProperty(Intl.PluralRules, 'name', {
value: 'PluralRules',
verifyNotEnumerable(Intl.PluralRules, "name"); writable: false,
verifyNotWritable(Intl.PluralRules, "name"); enumerable: false,
verifyConfigurable(Intl.PluralRules, "name"); configurable: true
});
// Copyright (C) 2017 André Bargull. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.PluralRules
description: >
"PluralRules" property of Intl.
info: |
Intl.PluralRules (...)
7 Requirements for Standard Built-in ECMAScript Objects
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 2018 Language
Specification, 9th edition, clause 17, or successor.
17 ECMAScript Standard Built-in Objects:
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]
---*/
verifyProperty(Intl, 'PluralRules', {
writable: true,
enumerable: false,
configurable: true
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment