From fbccd8eeffd21cfb6fee97493d347ae078f59d5c Mon Sep 17 00:00:00 2001 From: Rick Waldron <waldron.rick@gmail.com> Date: Fri, 18 May 2018 12:35:06 -0400 Subject: [PATCH] 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. --- .../Intl/getCanonicalLocales/descriptor.js | 8 +++-- .../Intl/getCanonicalLocales/duplicates.js | 2 +- .../Number/prototype/toLocaleString/length.js | 11 ++++--- test/intl402/NumberFormat/length.js | 7 +++++ test/intl402/NumberFormat/name.js | 11 ++++--- test/intl402/NumberFormat/prop-desc.js | 8 +++-- test/intl402/PluralRules/length.js | 11 ++++--- test/intl402/PluralRules/name.js | 11 ++++--- test/intl402/PluralRules/prop-desc.js | 31 +++++++++++++++++++ 9 files changed, 73 insertions(+), 27 deletions(-) create mode 100644 test/intl402/PluralRules/prop-desc.js diff --git a/test/intl402/Intl/getCanonicalLocales/descriptor.js b/test/intl402/Intl/getCanonicalLocales/descriptor.js index 1cf400ce21..e1f3232258 100644 --- a/test/intl402/Intl/getCanonicalLocales/descriptor.js +++ b/test/intl402/Intl/getCanonicalLocales/descriptor.js @@ -15,6 +15,8 @@ info: | includes: [propertyHelper.js] ---*/ -verifyNotEnumerable(Intl, "getCanonicalLocales"); -verifyWritable(Intl, "getCanonicalLocales"); -verifyConfigurable(Intl, "getCanonicalLocales"); +verifyProperty(Intl, 'getCanonicalLocales', { + writable: true, + enumerable: false, + configurable: true, +}); diff --git a/test/intl402/Intl/getCanonicalLocales/duplicates.js b/test/intl402/Intl/getCanonicalLocales/duplicates.js index 74fc6459c8..cff587ca3c 100644 --- a/test/intl402/Intl/getCanonicalLocales/duplicates.js +++ b/test/intl402/Intl/getCanonicalLocales/duplicates.js @@ -15,5 +15,5 @@ assert(compareArray( Intl.getCanonicalLocales( ['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'); diff --git a/test/intl402/Number/prototype/toLocaleString/length.js b/test/intl402/Number/prototype/toLocaleString/length.js index ff1538355a..48571eaaa6 100644 --- a/test/intl402/Number/prototype/toLocaleString/length.js +++ b/test/intl402/Number/prototype/toLocaleString/length.js @@ -24,8 +24,9 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Number.prototype.toLocaleString.length, 0); - -verifyNotEnumerable(Number.prototype.toLocaleString, "length"); -verifyNotWritable(Number.prototype.toLocaleString, "length"); -verifyConfigurable(Number.prototype.toLocaleString, "length"); +verifyProperty(Number.prototype.toLocaleString, 'length', { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); diff --git a/test/intl402/NumberFormat/length.js b/test/intl402/NumberFormat/length.js index e46a596ef1..647a1aca97 100644 --- a/test/intl402/NumberFormat/length.js +++ b/test/intl402/NumberFormat/length.js @@ -29,3 +29,10 @@ assert.sameValue(Intl.NumberFormat.length, 0); verifyNotEnumerable(Intl.NumberFormat, "length"); verifyNotWritable(Intl.NumberFormat, "length"); verifyConfigurable(Intl.NumberFormat, "length"); + +verifyProperty(Intl.NumberFormat, 'length', { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); diff --git a/test/intl402/NumberFormat/name.js b/test/intl402/NumberFormat/name.js index 5e95931366..41c0fcf199 100644 --- a/test/intl402/NumberFormat/name.js +++ b/test/intl402/NumberFormat/name.js @@ -19,8 +19,9 @@ info: | includes: [propertyHelper.js] ---*/ -assert.sameValue(Intl.NumberFormat.name, "NumberFormat"); - -verifyNotEnumerable(Intl.NumberFormat, "name"); -verifyNotWritable(Intl.NumberFormat, "name"); -verifyConfigurable(Intl.NumberFormat, "name"); +verifyProperty(Intl.NumberFormat, 'name', { + value: 'NumberFormat', + writable: false, + enumerable: false, + configurable: true +}); diff --git a/test/intl402/NumberFormat/prop-desc.js b/test/intl402/NumberFormat/prop-desc.js index e5878a70e9..81ed2e5a2b 100644 --- a/test/intl402/NumberFormat/prop-desc.js +++ b/test/intl402/NumberFormat/prop-desc.js @@ -24,6 +24,8 @@ info: | includes: [propertyHelper.js] ---*/ -verifyNotEnumerable(Intl, "NumberFormat"); -verifyWritable(Intl, "NumberFormat"); -verifyConfigurable(Intl, "NumberFormat"); +verifyProperty(Intl, 'NumberFormat', { + writable: true, + enumerable: false, + configurable: true +}); diff --git a/test/intl402/PluralRules/length.js b/test/intl402/PluralRules/length.js index 9f701deff4..33adaf70d1 100644 --- a/test/intl402/PluralRules/length.js +++ b/test/intl402/PluralRules/length.js @@ -8,8 +8,9 @@ author: Zibi Braniecki includes: [propertyHelper.js] ---*/ -assert.sameValue(Intl.PluralRules.length, 0); - -verifyNotEnumerable(Intl.PluralRules, "length"); -verifyNotWritable(Intl.PluralRules, "length"); -verifyConfigurable(Intl.PluralRules, "length"); +verifyProperty(Intl.PluralRules, 'length', { + value: 0, + writable: false, + enumerable: false, + configurable: true +}); diff --git a/test/intl402/PluralRules/name.js b/test/intl402/PluralRules/name.js index c5126aa88f..075d349dc8 100644 --- a/test/intl402/PluralRules/name.js +++ b/test/intl402/PluralRules/name.js @@ -8,8 +8,9 @@ author: Zibi Braniecki includes: [propertyHelper.js] ---*/ -assert.sameValue(Intl.PluralRules.name, "PluralRules"); - -verifyNotEnumerable(Intl.PluralRules, "name"); -verifyNotWritable(Intl.PluralRules, "name"); -verifyConfigurable(Intl.PluralRules, "name"); +verifyProperty(Intl.PluralRules, 'name', { + value: 'PluralRules', + writable: false, + enumerable: false, + configurable: true +}); diff --git a/test/intl402/PluralRules/prop-desc.js b/test/intl402/PluralRules/prop-desc.js new file mode 100644 index 0000000000..e0597da28e --- /dev/null +++ b/test/intl402/PluralRules/prop-desc.js @@ -0,0 +1,31 @@ +// 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 +}); -- GitLab