From 873a7241c357f0828c7f81a3bdedf30f141adb5a Mon Sep 17 00:00:00 2001 From: Rick Waldron Date: Wed, 9 Sep 2020 15:32:44 -0400 Subject: [PATCH] Fixup Intl.* this-value tests (delete dups, add proper esid) --- test/intl402/DateTimeFormat/12.1.1_1.js | 35 ------------------- .../DateTimeFormat/this-value-ignored.js | 2 +- test/intl402/NumberFormat/11.1.1_1.js | 35 ------------------- ...efault-currency-maximum-fraction-digits.js | 17 --------- .../NumberFormat/this-value-ignored.js | 2 +- 5 files changed, 2 insertions(+), 89 deletions(-) delete mode 100644 test/intl402/DateTimeFormat/12.1.1_1.js delete mode 100644 test/intl402/NumberFormat/11.1.1_1.js delete mode 100644 test/intl402/NumberFormat/default-currency-maximum-fraction-digits.js diff --git a/test/intl402/DateTimeFormat/12.1.1_1.js b/test/intl402/DateTimeFormat/12.1.1_1.js deleted file mode 100644 index 9cabc6e50b..0000000000 --- a/test/intl402/DateTimeFormat/12.1.1_1.js +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2012 Mozilla Corporation. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 12.1.1_1 -description: Tests that the this-value is ignored in DateTimeFormat. -author: Norbert Lindenberg -includes: [testIntl.js] ----*/ - -testWithIntlConstructors(function (Constructor) { - var obj, newObj; - - if (Constructor === Intl.DateTimeFormat) { - obj = new Constructor(); - newObj = Intl.DateTimeFormat.call(obj); - if (obj !== newObj) { - $ERROR("Should have modified existing object."); - } - var key = Object.getOwnPropertySymbols(newObj)[0]; - if (!(newObj[key] instanceof Intl.DateTimeFormat)) { - $ERROR("Should have installed a DateTimeFormat instance."); - } - return true; - } - - // variant 1: use constructor in a "new" expression - obj = new Constructor(); - newObj = Intl.DateTimeFormat.call(obj); - if (obj === newObj) { - $ERROR("DateTimeFormat object created with \"new\" was not ignored as this-value."); - } - - return true; -}); diff --git a/test/intl402/DateTimeFormat/this-value-ignored.js b/test/intl402/DateTimeFormat/this-value-ignored.js index 33b6bfb455..ad8ef3241c 100644 --- a/test/intl402/DateTimeFormat/this-value-ignored.js +++ b/test/intl402/DateTimeFormat/this-value-ignored.js @@ -2,7 +2,7 @@ // This code is governed by the BSD license found in the LICENSE file. /*--- -es5id: 12.1.1_1 +esid: sec-intl-datetimeformat-constructor description: > Tests that the this-value is ignored in DateTimeFormat, if the this-value isn't a DateTimeFormat instance. diff --git a/test/intl402/NumberFormat/11.1.1_1.js b/test/intl402/NumberFormat/11.1.1_1.js deleted file mode 100644 index b492a41183..0000000000 --- a/test/intl402/NumberFormat/11.1.1_1.js +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2012 Mozilla Corporation. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 11.1.1_1 -description: Tests that the this-value is ignored in NumberFormat. -author: Norbert Lindenberg -includes: [testIntl.js] ----*/ - -testWithIntlConstructors(function (Constructor) { - var obj, newObj; - - if (Constructor === Intl.NumberFormat) { - obj = new Constructor(); - newObj = Intl.NumberFormat.call(obj); - if (obj !== newObj) { - $ERROR("Should have modified existing object."); - } - var key = Object.getOwnPropertySymbols(newObj)[0]; - if (!(newObj[key] instanceof Intl.NumberFormat)) { - $ERROR("Should have installed a NumberFormat instance."); - } - return true; - } - - // variant 1: use constructor in a "new" expression - obj = new Constructor(); - newObj = Intl.NumberFormat.call(obj); - if (obj === newObj) { - $ERROR("NumberFormat object created with \"new\" was not ignored as this-value."); - } - - return true; -}); diff --git a/test/intl402/NumberFormat/default-currency-maximum-fraction-digits.js b/test/intl402/NumberFormat/default-currency-maximum-fraction-digits.js deleted file mode 100644 index 9ca6ffe2b9..0000000000 --- a/test/intl402/NumberFormat/default-currency-maximum-fraction-digits.js +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2017 the V8 project authors. All rights reserved. -// This code is governed by the license found in the LICENSE file. - -/*--- -esid: ECMA-402 #sec-setnfdigitoptions -description: > - When a currency is used in Intl.NumberFormat and minimumFractionDigits is - not provided, maximumFractionDigits should be range-checked against it. -include: [assert.js] ----*/ - -assert.throws(RangeError, - () => new Intl.NumberFormat('en', { - style: 'currency', - currency: 'USD', - maximumFractionDigits: 1 - })); diff --git a/test/intl402/NumberFormat/this-value-ignored.js b/test/intl402/NumberFormat/this-value-ignored.js index 3850653946..05b7a23ba7 100644 --- a/test/intl402/NumberFormat/this-value-ignored.js +++ b/test/intl402/NumberFormat/this-value-ignored.js @@ -2,7 +2,7 @@ // This code is governed by the BSD license found in the LICENSE file. /*--- -es5id: 11.1.1_1 +esid: sec-intl-numberformat-constructor description: > Tests that the this-value is ignored in NumberFormat, if the this-value isn't a NumberFormat instance.