From 96321f30c9576b40c8ad68ba3782d3f30de9fdb0 Mon Sep 17 00:00:00 2001 From: Norbert Lindenberg Date: Sun, 24 Mar 2013 23:48:59 -0700 Subject: [PATCH] New tests and test fixes for ECMAScript Internationalization API. Updated copyright notice for 2013. --- LICENSE | 2 +- console/harness/testIntl.js | 40 +++++++- test/harness/testIntl.js | 40 +++++++- test/suite/intl402/ch06/6.2/6.2.2_a.js | 8 +- test/suite/intl402/ch06/6.3/6.3.1_b.js | 5 +- test/suite/intl402/ch08/8.0/8.0.js | 12 +++ test/suite/intl402/ch10/10.1/10.1.1_a.js | 14 +++ .../ch10/10.2/{10.2.2.js => 10.2.2_a.js} | 0 test/suite/intl402/ch10/10.2/10.2.2_b.js | 13 +++ test/suite/intl402/ch11/11.1/11.1.1_20_c.js | 6 +- test/suite/intl402/ch11/11.1/11.1.1_32.js | 44 +++++++++ test/suite/intl402/ch11/11.1/11.1.1_a.js | 18 ++++ .../ch11/11.2/{11.2.2.js => 11.2.2_a.js} | 0 test/suite/intl402/ch11/11.2/11.2.2_b.js | 13 +++ test/suite/intl402/ch11/11.3/11.3.2_1_a_ii.js | 2 +- test/suite/intl402/ch12/12.1/12.1.1_a.js | 18 ++++ .../ch12/12.2/{12.2.2.js => 12.2.2_a.js} | 0 test/suite/intl402/ch12/12.2/12.2.2_b.js | 13 +++ .../ch13/13.1/{13.1.1_6.js => 13.1.1_6_1.js} | 0 test/suite/intl402/ch13/13.1/13.1.1_6_2.js | 13 +++ .../ch13/13.2/{13.2.1_4.js => 13.2.1_4_1.js} | 0 test/suite/intl402/ch13/13.2/13.2.1_4_2.js | 13 +++ .../ch13/13.3/{13.3.0_6.js => 13.3.0_6_1.js} | 0 test/suite/intl402/ch13/13.3/13.3.0_6_2.js | 15 +++ website/harness/testIntl.js | 40 +++++++- website/json/intl402.json | 99 ++++++++++++++++--- website/json/suiteDescrip.json | 2 +- website/json/testcases_intl402.json | 2 +- 28 files changed, 408 insertions(+), 24 deletions(-) create mode 100644 test/suite/intl402/ch08/8.0/8.0.js create mode 100644 test/suite/intl402/ch10/10.1/10.1.1_a.js rename test/suite/intl402/ch10/10.2/{10.2.2.js => 10.2.2_a.js} (100%) create mode 100644 test/suite/intl402/ch10/10.2/10.2.2_b.js create mode 100644 test/suite/intl402/ch11/11.1/11.1.1_32.js create mode 100644 test/suite/intl402/ch11/11.1/11.1.1_a.js rename test/suite/intl402/ch11/11.2/{11.2.2.js => 11.2.2_a.js} (100%) create mode 100644 test/suite/intl402/ch11/11.2/11.2.2_b.js create mode 100644 test/suite/intl402/ch12/12.1/12.1.1_a.js rename test/suite/intl402/ch12/12.2/{12.2.2.js => 12.2.2_a.js} (100%) create mode 100644 test/suite/intl402/ch12/12.2/12.2.2_b.js rename test/suite/intl402/ch13/13.1/{13.1.1_6.js => 13.1.1_6_1.js} (100%) create mode 100644 test/suite/intl402/ch13/13.1/13.1.1_6_2.js rename test/suite/intl402/ch13/13.2/{13.2.1_4.js => 13.2.1_4_1.js} (100%) create mode 100644 test/suite/intl402/ch13/13.2/13.2.1_4_2.js rename test/suite/intl402/ch13/13.3/{13.3.0_6.js => 13.3.0_6_1.js} (100%) create mode 100644 test/suite/intl402/ch13/13.3/13.3.0_6_2.js diff --git a/LICENSE b/LICENSE index f3f2b988c8..46b55a37b3 100644 --- a/LICENSE +++ b/LICENSE @@ -5,7 +5,7 @@ are granted under this license even if the third party concerned is a member of CODE OF CONDUCT IN PATENT MATTERS AVAILABLE AT http://www.ecma-international.org/memento/codeofconduct.htm FOR INFORMATION REGARDING THE LICENSING OF PATENT CLAIMS THAT ARE REQUIRED TO IMPLEMENT ECMA INTERNATIONAL STANDARDS*. -Copyright (C) <<2012>> <> +Copyright (C) 2012-2013 Ecma International All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the diff --git a/console/harness/testIntl.js b/console/harness/testIntl.js index 365b1555dd..b009a2e9ed 100644 --- a/console/harness/testIntl.js +++ b/console/harness/testIntl.js @@ -1,5 +1,5 @@ // Copyright 2011-2012 Norbert Lindenberg. All rights reserved. -// Copyright 2012 Mozilla Corporation. All rights reserved. +// Copyright 2012-2013 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /** @@ -860,6 +860,44 @@ function mustNotHaveProperty(obj, property) { } +/** + * Properties of the RegExp constructor that may be affected by use of regular + * expressions, and the default values of these properties. Properties are from + * https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Deprecated_and_obsolete_features#RegExp_Properties + */ +var regExpProperties = ["$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8", "$9", + "$_", "$*", "$&", "$+", "$`", "$'", + "input", "lastMatch", "lastParen", "leftContext", "rightContext" +]; + +var regExpPropertiesDefaultValues = (function () { + var values = Object.create(null); + regExpProperties.forEach(function (property) { + values[property] = RegExp[property]; + }); + return values; +}()); + + +/** + * Tests that executing the provided function (which may use regular expressions + * in its implementation) does not create or modify unwanted properties on the + * RegExp constructor. + */ +function testForUnwantedRegExpChanges(testFunc) { + regExpProperties.forEach(function (property) { + RegExp[property] = regExpPropertiesDefaultValues[property]; + }); + testFunc(); + regExpProperties.forEach(function (property) { + if (RegExp[property] !== regExpPropertiesDefaultValues[property]) { + $ERROR("RegExp has unexpected property " + property + " with value " + + RegExp[property] + "."); + } + }); +} + + /** * Tests whether name is a valid BCP 47 numbering system name * and not excluded from use in the ECMAScript Internationalization API. diff --git a/test/harness/testIntl.js b/test/harness/testIntl.js index 365b1555dd..b009a2e9ed 100644 --- a/test/harness/testIntl.js +++ b/test/harness/testIntl.js @@ -1,5 +1,5 @@ // Copyright 2011-2012 Norbert Lindenberg. All rights reserved. -// Copyright 2012 Mozilla Corporation. All rights reserved. +// Copyright 2012-2013 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /** @@ -860,6 +860,44 @@ function mustNotHaveProperty(obj, property) { } +/** + * Properties of the RegExp constructor that may be affected by use of regular + * expressions, and the default values of these properties. Properties are from + * https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Deprecated_and_obsolete_features#RegExp_Properties + */ +var regExpProperties = ["$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8", "$9", + "$_", "$*", "$&", "$+", "$`", "$'", + "input", "lastMatch", "lastParen", "leftContext", "rightContext" +]; + +var regExpPropertiesDefaultValues = (function () { + var values = Object.create(null); + regExpProperties.forEach(function (property) { + values[property] = RegExp[property]; + }); + return values; +}()); + + +/** + * Tests that executing the provided function (which may use regular expressions + * in its implementation) does not create or modify unwanted properties on the + * RegExp constructor. + */ +function testForUnwantedRegExpChanges(testFunc) { + regExpProperties.forEach(function (property) { + RegExp[property] = regExpPropertiesDefaultValues[property]; + }); + testFunc(); + regExpProperties.forEach(function (property) { + if (RegExp[property] !== regExpPropertiesDefaultValues[property]) { + $ERROR("RegExp has unexpected property " + property + " with value " + + RegExp[property] + "."); + } + }); +} + + /** * Tests whether name is a valid BCP 47 numbering system name * and not excluded from use in the ECMAScript Internationalization API. diff --git a/test/suite/intl402/ch06/6.2/6.2.2_a.js b/test/suite/intl402/ch06/6.2/6.2.2_a.js index 144a1e7c97..a56894570b 100644 --- a/test/suite/intl402/ch06/6.2/6.2.2_a.js +++ b/test/suite/intl402/ch06/6.2/6.2.2_a.js @@ -21,7 +21,13 @@ var validLanguageTags = [ "i-klingon", // grandfathered tag "cmn-hans-cn-t-ca-u-ca-x-t-u", // singleton subtags can also be used as private use subtags "enochian-enochian", // language and variant subtags may be the same - "de-gregory-u-ca-gregory" // variant and extension subtags may be the same + "de-gregory-u-ca-gregory", // variant and extension subtags may be the same + "aa-a-foo-x-a-foo-bar", // variant subtags can also be used as private use subtags + "x-en-US-12345", // anything goes in private use tags + "x-12345-12345-en-US", + "x-en-US-12345-12345", + "x-en-u-foo", + "x-en-u-foo-u-bar" ]; testWithIntlConstructors(function (Constructor) { diff --git a/test/suite/intl402/ch06/6.3/6.3.1_b.js b/test/suite/intl402/ch06/6.3/6.3.1_b.js index 90051b343c..038dd1fc4a 100644 --- a/test/suite/intl402/ch06/6.3/6.3.1_b.js +++ b/test/suite/intl402/ch06/6.3/6.3.1_b.js @@ -7,6 +7,7 @@ */ var invalidCurrencyCodes = [ + "", "€", "$", "SFr.", @@ -26,9 +27,9 @@ invalidCurrencyCodes.forEach(function (code) { error = e; } if (error === undefined) { - $ERROR("Invalid currency code " + code + " was not rejected."); + $ERROR("Invalid currency code '" + code + "' was not rejected."); } else if (error.name !== "RangeError") { - $ERROR("Invalid currency code " + code + " was rejected with wrong error " + error.name + "."); + $ERROR("Invalid currency code '" + code + "' was rejected with wrong error " + error.name + "."); } }); diff --git a/test/suite/intl402/ch08/8.0/8.0.js b/test/suite/intl402/ch08/8.0/8.0.js new file mode 100644 index 0000000000..dedda973b2 --- /dev/null +++ b/test/suite/intl402/ch08/8.0/8.0.js @@ -0,0 +1,12 @@ +// Copyright 2013 Mozilla Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/** + * @description Tests that Intl has Object.prototype as its prototype. + * @author Norbert Lindenberg + */ + +if (Object.getPrototypeOf(Intl) !== Object.prototype) { + $ERROR("Intl doesn't have Object.prototype as its prototype."); +} + diff --git a/test/suite/intl402/ch10/10.1/10.1.1_a.js b/test/suite/intl402/ch10/10.1/10.1.1_a.js new file mode 100644 index 0000000000..56d4b97895 --- /dev/null +++ b/test/suite/intl402/ch10/10.1/10.1.1_a.js @@ -0,0 +1,14 @@ +// Copyright 2013 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that constructing a Collator doesn't create or modify + * unwanted properties on the RegExp constructor. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +testForUnwantedRegExpChanges(function () { + new Intl.Collator("de-DE-u-co-phonebk"); +}); diff --git a/test/suite/intl402/ch10/10.2/10.2.2.js b/test/suite/intl402/ch10/10.2/10.2.2_a.js similarity index 100% rename from test/suite/intl402/ch10/10.2/10.2.2.js rename to test/suite/intl402/ch10/10.2/10.2.2_a.js diff --git a/test/suite/intl402/ch10/10.2/10.2.2_b.js b/test/suite/intl402/ch10/10.2/10.2.2_b.js new file mode 100644 index 0000000000..1b99fd8c5a --- /dev/null +++ b/test/suite/intl402/ch10/10.2/10.2.2_b.js @@ -0,0 +1,13 @@ +// Copyright 2013 Mozilla Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/** + * @description Tests that Intl.Collator.supportedLocalesOf + * doesn't access arguments that it's not given. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +taintDataProperty(Object.prototype, "1"); +new Intl.Collator("und"); diff --git a/test/suite/intl402/ch11/11.1/11.1.1_20_c.js b/test/suite/intl402/ch11/11.1/11.1.1_20_c.js index 8d984ebf5c..20b7910b02 100644 --- a/test/suite/intl402/ch11/11.1/11.1.1_20_c.js +++ b/test/suite/intl402/ch11/11.1/11.1.1_20_c.js @@ -7,7 +7,7 @@ * @author Norbert Lindenberg */ -// data from http://www.currency-iso.org/dl_iso_table_a1.xml, 2012-08-10 +// data from http://www.currency-iso.org/dl_iso_table_a1.xml, 2013-02-25 var currencyDigits = { AED: 2, AFN: 2, @@ -158,7 +158,7 @@ var currencyDigits = { TWD: 2, TZS: 2, UAH: 2, - UGX: 2, +// UGX: 2, will be changed to 0 when maintenance agency releases updated table USD: 2, USN: 2, USS: 2, @@ -175,7 +175,7 @@ var currencyDigits = { XPF: 0, YER: 2, ZAR: 2, - ZMK: 2, + ZMW: 2, ZWL: 2 }; diff --git a/test/suite/intl402/ch11/11.1/11.1.1_32.js b/test/suite/intl402/ch11/11.1/11.1.1_32.js new file mode 100644 index 0000000000..9196318efb --- /dev/null +++ b/test/suite/intl402/ch11/11.1/11.1.1_32.js @@ -0,0 +1,44 @@ +// Copyright 2013 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that the options minimumSignificantDigits and + * maximumSignificantDigits are read in the right sequence. + * @author Norbert Lindenberg + */ + +var read = 0; + +function readMinimumSignificantDigits() { + ++read; + if (read === 1) { + return 0; // invalid value, but on first read that's OK + } else if (read === 3) { + return 1; // valid value + } else { + $ERROR("minimumSignificantDigits read out of sequence: " + read + "."); + } +} + +function readMaximumSignificantDigits() { + ++read; + if (read === 2) { + return 0; // invalid value, but on first read that's OK + } else if (read === 4) { + return 1; // valid value + } else { + $ERROR("maximumSignificantDigits read out of sequence: " + read + "."); + } +} + +var options = {}; +Object.defineProperty(options, "minimumSignificantDigits", + { get: readMinimumSignificantDigits }); +Object.defineProperty(options, "maximumSignificantDigits", + { get: readMaximumSignificantDigits }); + +new Intl.NumberFormat("de", options); + +if (read !== 4) { + $ERROR("insuffient number of property reads: " + read + "."); +} diff --git a/test/suite/intl402/ch11/11.1/11.1.1_a.js b/test/suite/intl402/ch11/11.1/11.1.1_a.js new file mode 100644 index 0000000000..611816b61c --- /dev/null +++ b/test/suite/intl402/ch11/11.1/11.1.1_a.js @@ -0,0 +1,18 @@ +// Copyright 2013 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that constructing a NumberFormat doesn't create or modify + * unwanted properties on the RegExp constructor. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +testForUnwantedRegExpChanges(function () { + new Intl.NumberFormat("de-DE-u-nu-latn"); +}); + +testForUnwantedRegExpChanges(function () { + new Intl.NumberFormat("de-DE-u-nu-latn", {style: "currency", currency: "EUR"}); +}); diff --git a/test/suite/intl402/ch11/11.2/11.2.2.js b/test/suite/intl402/ch11/11.2/11.2.2_a.js similarity index 100% rename from test/suite/intl402/ch11/11.2/11.2.2.js rename to test/suite/intl402/ch11/11.2/11.2.2_a.js diff --git a/test/suite/intl402/ch11/11.2/11.2.2_b.js b/test/suite/intl402/ch11/11.2/11.2.2_b.js new file mode 100644 index 0000000000..6b4d77e773 --- /dev/null +++ b/test/suite/intl402/ch11/11.2/11.2.2_b.js @@ -0,0 +1,13 @@ +// Copyright 2013 Mozilla Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/** + * @description Tests that Intl.NumberFormat.supportedLocalesOf + * doesn't access arguments that it's not given. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +taintDataProperty(Object.prototype, "1"); +new Intl.NumberFormat("und"); diff --git a/test/suite/intl402/ch11/11.3/11.3.2_1_a_ii.js b/test/suite/intl402/ch11/11.3/11.3.2_1_a_ii.js index bcf4cffffd..cb284f43ef 100644 --- a/test/suite/intl402/ch11/11.3/11.3.2_1_a_ii.js +++ b/test/suite/intl402/ch11/11.3/11.3.2_1_a_ii.js @@ -8,7 +8,7 @@ */ var formatter = new Intl.NumberFormat(); -var testData = [undefined, null, true, '0.6666666']; +var testData = [undefined, null, true, '0.6666666', {valueOf: function () { return '0.1234567';}}]; var number; var i, input, correctResult, result; diff --git a/test/suite/intl402/ch12/12.1/12.1.1_a.js b/test/suite/intl402/ch12/12.1/12.1.1_a.js new file mode 100644 index 0000000000..4f5f3dbf5e --- /dev/null +++ b/test/suite/intl402/ch12/12.1/12.1.1_a.js @@ -0,0 +1,18 @@ +// Copyright 2013 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/** + * @description Tests that constructing a DateTimeFormat doesn't create or modify + * unwanted properties on the RegExp constructor. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +testForUnwantedRegExpChanges(function () { + new Intl.DateTimeFormat("de-DE-u-ca-gregory"); +}); + +testForUnwantedRegExpChanges(function () { + new Intl.DateTimeFormat("de-DE-u-ca-gregory", {timeZone: "UTC"}); +}); diff --git a/test/suite/intl402/ch12/12.2/12.2.2.js b/test/suite/intl402/ch12/12.2/12.2.2_a.js similarity index 100% rename from test/suite/intl402/ch12/12.2/12.2.2.js rename to test/suite/intl402/ch12/12.2/12.2.2_a.js diff --git a/test/suite/intl402/ch12/12.2/12.2.2_b.js b/test/suite/intl402/ch12/12.2/12.2.2_b.js new file mode 100644 index 0000000000..06bc8027e7 --- /dev/null +++ b/test/suite/intl402/ch12/12.2/12.2.2_b.js @@ -0,0 +1,13 @@ +// Copyright 2013 Mozilla Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/** + * @description Tests that Intl.DateTimeFormat.supportedLocalesOf + * doesn't access arguments that it's not given. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +taintDataProperty(Object.prototype, "1"); +new Intl.DateTimeFormat("und"); diff --git a/test/suite/intl402/ch13/13.1/13.1.1_6.js b/test/suite/intl402/ch13/13.1/13.1.1_6_1.js similarity index 100% rename from test/suite/intl402/ch13/13.1/13.1.1_6.js rename to test/suite/intl402/ch13/13.1/13.1.1_6_1.js diff --git a/test/suite/intl402/ch13/13.1/13.1.1_6_2.js b/test/suite/intl402/ch13/13.1/13.1.1_6_2.js new file mode 100644 index 0000000000..481a7803b2 --- /dev/null +++ b/test/suite/intl402/ch13/13.1/13.1.1_6_2.js @@ -0,0 +1,13 @@ +// Copyright 2013 Mozilla Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/** + * @description Tests that String.prototype.localeCompare uses the standard + * built-in Intl.Collator constructor. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +taintDataProperty(Intl, "Collator"); +"a".localeCompare("b"); diff --git a/test/suite/intl402/ch13/13.2/13.2.1_4.js b/test/suite/intl402/ch13/13.2/13.2.1_4_1.js similarity index 100% rename from test/suite/intl402/ch13/13.2/13.2.1_4.js rename to test/suite/intl402/ch13/13.2/13.2.1_4_1.js diff --git a/test/suite/intl402/ch13/13.2/13.2.1_4_2.js b/test/suite/intl402/ch13/13.2/13.2.1_4_2.js new file mode 100644 index 0000000000..a79cfffde7 --- /dev/null +++ b/test/suite/intl402/ch13/13.2/13.2.1_4_2.js @@ -0,0 +1,13 @@ +// Copyright 2013 Mozilla Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/** + * @description Tests that Number.prototype.toLocaleString uses the standard + * built-in Intl.NumberFormat constructor. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +taintDataProperty(Intl, "NumberFormat"); +(0.0).toLocaleString(); diff --git a/test/suite/intl402/ch13/13.3/13.3.0_6.js b/test/suite/intl402/ch13/13.3/13.3.0_6_1.js similarity index 100% rename from test/suite/intl402/ch13/13.3/13.3.0_6.js rename to test/suite/intl402/ch13/13.3/13.3.0_6_1.js diff --git a/test/suite/intl402/ch13/13.3/13.3.0_6_2.js b/test/suite/intl402/ch13/13.3/13.3.0_6_2.js new file mode 100644 index 0000000000..dcce059066 --- /dev/null +++ b/test/suite/intl402/ch13/13.3/13.3.0_6_2.js @@ -0,0 +1,15 @@ +// Copyright 2013 Mozilla Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/** + * @description Tests that Date.prototype.toLocaleString & Co. use the standard + * built-in Intl.DateTimeFormat constructor. + * @author Norbert Lindenberg + */ + +$INCLUDE("testIntl.js"); + +taintDataProperty(Intl, "DateTimeFormat"); +new Date().toLocaleString(); +new Date().toLocaleDateString(); +new Date().toLocaleTimeString(); diff --git a/website/harness/testIntl.js b/website/harness/testIntl.js index 365b1555dd..b009a2e9ed 100644 --- a/website/harness/testIntl.js +++ b/website/harness/testIntl.js @@ -1,5 +1,5 @@ // Copyright 2011-2012 Norbert Lindenberg. All rights reserved. -// Copyright 2012 Mozilla Corporation. All rights reserved. +// Copyright 2012-2013 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /** @@ -860,6 +860,44 @@ function mustNotHaveProperty(obj, property) { } +/** + * Properties of the RegExp constructor that may be affected by use of regular + * expressions, and the default values of these properties. Properties are from + * https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Deprecated_and_obsolete_features#RegExp_Properties + */ +var regExpProperties = ["$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8", "$9", + "$_", "$*", "$&", "$+", "$`", "$'", + "input", "lastMatch", "lastParen", "leftContext", "rightContext" +]; + +var regExpPropertiesDefaultValues = (function () { + var values = Object.create(null); + regExpProperties.forEach(function (property) { + values[property] = RegExp[property]; + }); + return values; +}()); + + +/** + * Tests that executing the provided function (which may use regular expressions + * in its implementation) does not create or modify unwanted properties on the + * RegExp constructor. + */ +function testForUnwantedRegExpChanges(testFunc) { + regExpProperties.forEach(function (property) { + RegExp[property] = regExpPropertiesDefaultValues[property]; + }); + testFunc(); + regExpProperties.forEach(function (property) { + if (RegExp[property] !== regExpPropertiesDefaultValues[property]) { + $ERROR("RegExp has unexpected property " + property + " with value " + + RegExp[property] + "."); + } + }); +} + + /** * Tests whether name is a valid BCP 47 numbering system name * and not excluded from use in the ECMAScript Internationalization API. diff --git a/website/json/intl402.json b/website/json/intl402.json index b032a4edd0..ba56e908c8 100644 --- a/website/json/intl402.json +++ b/website/json/intl402.json @@ -1,11 +1,11 @@ { "testsCollection":{ "name":"Chapter - intl402", -"numTests":"142", +"numTests":"153", "tests":[ { "author":"Norbert Lindenberg", -"code":"Ly8gQ29weXJpZ2h0IDIwMTIgTW96aWxsYSBDb3Jwb3JhdGlvbi4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KLyoqCiAqIEBkZXNjcmlwdGlvbiBUZXN0cyB0aGF0IHN0cnVjdHVyYWxseSB2YWxpZCBsYW5ndWFnZSB0YWdzIGFyZSBhY2NlcHRlZC4KICogQGF1dGhvciBOb3JiZXJ0IExpbmRlbmJlcmcKICovCgokSU5DTFVERSgidGVzdEludGwuanMiKTsKCnZhciB2YWxpZExhbmd1YWdlVGFncyA9IFsKICAgICJkZSIsIC8vIElTTyA2MzkgbGFuZ3VhZ2UgY29kZQogICAgImRlLURFIiwgLy8gKyBJU08gMzE2Ni0xIGNvdW50cnkgY29kZQogICAgIkRFLWRlIiwgLy8gdGFncyBhcmUgY2FzZS1pbnNlbnNpdGl2ZQogICAgImNtbiIsIC8vIElTTyA2MzkgbGFuZ3VhZ2UgY29kZQogICAgImNtbi1IYW5zIiwgLy8gKyBzY3JpcHQgY29kZQogICAgIkNNTi1oQU5TIiwgLy8gdGFncyBhcmUgY2FzZS1pbnNlbnNpdGl2ZQogIC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CBzdWJ0YWdzIGNhbiBhbHNvIGJlIHVzZWQgYXMgcHJpdmF0ZSB1c2Ugc3VidGFncwogICAgIngtZW4tVVMtMTIzNDUiLCAvLyBhbnl0aGluZyBnb2VzIGluIHByaXZhdGUgdXNlIHRhZ3MKICAgICJ4LTEyMzQ1LTEyMzQ1LWVuLVVTIiwKICAgICJ4LWVuLVVTLTEyMzQ1LTEyMzQ1IiwKICAgICJ4LWVuLXUtZm9vIiwKICAgICJ4LWVuLXUtZm9vLXUtYmFyIgpdOwoKdGVzdFdpdGhJbnRsQ29uc3RydWN0b3JzKGZ1bmN0aW9uIChDb25zdHJ1Y3RvcikgewogICAgdmFsaWRMYW5ndWFnZVRhZ3MuZm9yRWFjaChmdW5jdGlvbiAodGFnKSB7CiAgICAgICAgLy8gdGhpcyBtdXN0IG5vdCB0aHJvdyBhbiBleGNlcHRpb24gZm9yIGEgdmFsaWQgbGFuZ3VhZ2UgdGFnCiAgICAgICAgdmFyIG9iaiA9IG5ldyBDb25zdHJ1Y3RvcihbdGFnXSk7CiAgICB9KTsKICAgIHJldHVybiB0cnVlOwp9KTsKCg==", "commentary":"", "description":"Tests that structurally valid language tags are accepted.", "path":"TestCases/intl402/ch06/6.2/6.2.2_a.js" @@ -47,7 +47,7 @@ }, { "author":"Norbert Lindenberg", -"code":"Ly8gQ29weXJpZ2h0IDIwMTIgTW96aWxsYSBDb3Jwb3JhdGlvbi4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KLyoqCiAqIEBkZXNjcmlwdGlvbiBUZXN0cyB0aGF0IGludmFsaWQgY3VycmVuY3kgY29kZXMgYXJlIG5vdCBhY2NlcHRlZC4KICogQGF1dGhvciBOb3JiZXJ0IExpbmRlbmJlcmcKICovCgp2YXIgaW52YWxpZEN1cnJlbmN5Q29kZXMgPSBbCiAgICAi4oKsIiwKICAgICIkIiwKICAgICJTRnIuIiwKICAgICJETSIsCiAgICAiS1LigqkiLAogICAgIjcwMiIsCiAgICAiw59QIiwKICAgICLE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n1AiLAogICAgIsSxbnIiCl07CgppbnZhbGlkQ3VycmVuY3lDb2Rlcy5mb3JFYWNoKGZ1bmN0aW9uIChjb2RlKSB7CiAgICB2YXIgZXJyb3I7CiAgICB0cnkgewogICAgICAgIC8vIHRoaXMgbXVzdCB0aHJvdyBhbiBleGNlcHRpb24gZm9yIGFuIGludmFsaWQgY3VycmVuY3kgY29kZQogICAgICAgIHZhciBmb3JtYXQgPSBuZXcgSW50bC5OdW1iZXJGb3JtYXQoWyJkZS1kZSJdLCB7c3R5bGU6ICJjdXJyZW5jeSIsIGN1cnJlbmN5OiBjb2RlfSk7CiAgICB9IGNhdGNoIChlKSB7CiAgICAgICAgZXJyb3IgPSBlOwogICAgfQogICAgaWYgKGVycm9yID09PSB1bmRlZmluZWQpIHsKICAgICAgICAkRVJST1IoIkludmFsaWQgY3VycmVuY3kgY29kZSAnIiArIGNvZGUgKyAiJyB3YXMgbm90IHJlamVjdGVkLiIpOwogICAgfSBlbHNlIGlmIChlcnJvci5uYW1lICE9PSAiUmFuZ2VFcnJvciIpIHsKICAgICAgICAkRVJST1IoIkludmFsaWQgY3VycmVuY3kgY29kZSAnIiArIGNvZGUgKyAiJyB3YXMgcmVqZWN0ZWQgd2l0aCB3cm9uZyBlcnJvciAiICsgZXJyb3IubmFtZSArICIuIik7CiAgICB9Cn0pOwoK", "commentary":"", "description":"Tests that invalid currency codes are not accepted.", "path":"TestCases/intl402/ch06/6.3/6.3.1_b.js" @@ -75,6 +75,13 @@ }, { "author":"Norbert Lindenberg", +"code":"Ly8gQ29weXJpZ2h0IDIwMTMgTW96aWxsYSBDb3Jwb3JhdGlvbi4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KLyoqCiAqIEBkZXNjcmlwdGlvbiBUZXN0cyB0aGF0IEludGwgaGFzIE9iamVjdC5wcm90b3R5cGUgYXMgaXRzIHByb3RvdHlwZS4KICogQGF1dGhvciBOb3JiZXJ0IExpbmRlbmJlcmcKICovCgppZiAoT2JqZWN0LmdldFByb3RvdHlwZU9mKEludGwpICE9PSBPYmplY3QucHJvdG90eXBlKSB7CiAgICAkRVJST1IoIkludGwgZG9lc24ndCBoYXZlIE9iamVjdC5wcm90b3R5cGUgYXMgaXRzIHByb3RvdHlwZS4iKTsKfQoK", +"commentary":"", +"description":"Tests that Intl has Object.prototype as its prototype.", +"path":"TestCases/intl402/ch08/8.0/8.0.js" +}, +{ +"author":"Norbert Lindenberg", "code":"Ly8gQ29weXJpZ2h0IDIwMTIgTW96aWxsYSBDb3Jwb3JhdGlvbi4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KLyoqCiAqIEBkZXNjcmlwdGlvbiBUZXN0cyB0aGF0IEludGwKICogICAgIG1lZXRzIHRoZSByZXF1aXJlbWVudHMgZm9yIGJ1aWx0LWluIG9iamVjdHMgZGVmaW5lZCBieSB0aGUgaW50cm9kdWN0aW9uIG9mCiAqICAgICBjaGFwdGVyIDE1IG9mIHRoZSBFQ01BU2NyaXB0IExhbmd1YWdlIFNwZWNpZmljYXRpb24uCiAqIEBhdXRob3IgTm9yYmVydCBMaW5kZW5iZXJnCiAqLwoKJElOQ0xVREUoInRlc3RCdWlsdEluT2JqZWN0LmpzIik7Cgp0ZXN0QnVpbHRJbk9iamVjdChmbkdsb2JhbE9iamVjdCgpLkludGwsIGZhbHNlLCBmYWxzZSwgW10pOwp0ZXN0QnVpbHRJbk9iamVjdChJbnRsLCBmYWxzZSwgZmFsc2UsIFsiQ29sbGF0b3IiLCAiTnVtYmVyRm9ybWF0IiwgIkRhdGVUaW1lRm9ybWF0Il0pOwoK", "commentary":"", "description":"Tests that Intl\n meets the requirements for built-in objects defined by the introduction of\n chapter 15 of the ECMAScript Language Specification.", @@ -271,6 +278,13 @@ }, { "author":"Norbert Lindenberg", +"code":"Ly8gQ29weXJpZ2h0IDIwMTMgTW96aWxsYSBDb3Jwb3JhdGlvbi4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KLyoqCiAqIEBkZXNjcmlwdGlvbiBUZXN0cyB0aGF0IGNvbnN0cnVjdGluZyBhIENvbGxhdG9yIGRvZXNuJ3QgY3JlYXRlIG9yIG1vZGlmeQogKiAgICAgdW53YW50ZWQgcHJvcGVydGllcyBvbiB0aGUgUmVnRXhwIGNvbnN0cnVjdG9yLgogKiBAYXV0aG9yIE5vcmJlcnQgTGluZGVuYmVyZwogKi8KCiRJTkNMVURFKCJ0ZXN0SW50bC5qcyIpOwoKdGVzdEZvclVud2FudGVkUmVnRXhwQ2hhbmdlcyhmdW5jdGlvbiAoKSB7CiAgICBuZXcgSW50bC5Db2xsYXRvcigiZGUtREUtdS1jby1waG9uZWJrIik7Cn0pOwo=", +"commentary":"", +"description":"Tests that constructing a Collator doesn't create or modify\n unwanted properties on the RegExp constructor.", +"path":"TestCases/intl402/ch10/10.1/10.1.1_a.js" +}, +{ +"author":"Norbert Lindenberg", "code":"Ly8gQ29weXJpZ2h0IDIwMTIgTW96aWxsYSBDb3Jwb3JhdGlvbi4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KLyoqCiAqIEBkZXNjcmlwdGlvbiBUZXN0cyB0aGF0IGZvciBub24tb2JqZWN0IHZhbHVlcyBwYXNzZWQgYXMgdGhpcyB0byBDb2xsYXRvciBhCiAqIHdyYXBwZXIgb2JqZWN0IHdpbGwgYmUgaW5pdGlhbGl6ZWQgYW5kIHJldHVybmVkLgogKiBAYXV0aG9yIE5vcmJlcnQgTGluZGVuYmVyZwogKi8KCnZhciB0aGlzVmFsdWVzID0gW3RydWUsIDQyLCAi5Zu96Zqb5YyWIl07Cgp0aGlzVmFsdWVzLmZvckVhY2goZnVuY3Rpb24gKHZhbHVlKSB7CiAgICB2YXIgY29sbGF0b3IgPSBJbnRsLkNvbGxhdG9yLmNhbGwodmFsdWUpOwogICAgLy8gY2hlY2sgdGhhdCB0aGUgcmV0dXJuZWQgb2JqZWN0IGZ1bmN0aW9ucyBhcyBhIGNvbGxhdG9yCiAgICB2YXIgcmVmZXJlbmNlQ29sbGF0b3IgPSBuZXcgSW50bC5Db2xsYXRvcigpOwogICAgaWYgKEludGwuQ29sbGF0b3IucHJvdG90eXBlLmNvbXBhcmUuY2FsbChjb2xsYXRvciwgImEiLCAiYiIpICE9PSByZWZlcmVuY2VDb2xsYXRvci5jb21wYXJlKCJhIiwgImIiKSkgewogICAgICAgICRFUlJPUigiQ29sbGF0b3IgaW5pdGlhbGl6ZWQgZnJvbSAiICsgdmFsdWUgKyAiIGRvZXNuJ3QgYmVoYXZlIGxpa2Ugbm9ybWFsIGNvbGxhdG9yLiIpOwogICAgfQogICAgcmV0dXJuIHRydWU7Cn0pOwoK", "commentary":"", "description":"Tests that for non-object values passed as this to Collator a\nwrapper object will be initialized and returned.", @@ -308,7 +322,14 @@ "code":"Ly8gQ29weXJpZ2h0IDIwMTIgR29vZ2xlIEluYy4gIEFsbCByaWdodHMgcmVzZXJ2ZWQuCi8qKgogKiBAZGVzY3JpcHRpb24gVGVzdHMgdGhhdCBJbnRsLkNvbGxhdG9yIGhhcyBhIHN1cHBvcnRlZExvY2FsZXNPZgogKiBwcm9wZXJ0eSwgYW5kIGl0IHdvcmtzIGFzIHBsYW5uZWQuCiAqLwoKdmFyIGRlZmF1bHRMb2NhbGUgPSBuZXcgSW50bC5Db2xsYXRvcigpLnJlc29sdmVkT3B0aW9ucygpLmxvY2FsZTsKdmFyIG5vdFN1cHBvcnRlZCA9ICd6eHgnOyAvLyAibm8gbGluZ3Vpc3RpYyBjb250ZW50Igp2YXIgcmVxdWVzdGVkTG9jYWxlcyA9IFtkZWZhdWx0TG9jYWxlLCBub3RTdXBwb3J0ZWRdOwoKdmFyIHN1cHBvcnRlZExvY2FsZXM7CgppZiAoIUludGwuQ29sbGF0b3IuaGFzT3duUHJvcGVydHkoJ3N1cHBvcnRlZExvY2FsZXNPZicpKSB7CiAgICAkRVJST1IoIkludGwuQ29sbGF0b3IgZG9lc24ndCBoYXZlIGEgc3VwcG9ydGVkTG9jYWxlc09mIHByb3BlcnR5LiIpOwp9CgpzdXBwb3J0ZWRMb2NhbGVzID0gSW50bC5Db2xsYXRvci5zdXBwb3J0ZWRMb2NhbGVzT2YocmVxdWVzdGVkTG9jYWxlcyk7CmlmIChzdXBwb3J0ZWRMb2NhbGVzLmxlbmd0aCAhPT0gMSkgewogICAgJEVSUk9SKCdUaGUgbGVuZ3RoIG9mIHN1cHBvcnRlZCBsb2NhbGVzIGxpc3QgaXMgbm90IDEuJyk7Cn0KCmlmIChzdXBwb3J0ZWRMb2NhbGVzWzBdICE9PSBkZWZhdWx0TG9jYWxlKSB7CiAgICAkRVJST1IoJ1RoZSBkZWZhdWx0IGxvY2FsZSBpcyBub3QgcmV0dXJuZWQgaW4gdGhlIHN1cHBvcnRlZCBsaXN0LicpOwp9Cgo=", "commentary":"", "description":"Tests that Intl.Collator has a supportedLocalesOf\nproperty, and it works as planned.", -"path":"TestCases/intl402/ch10/10.2/10.2.2.js" +"path":"TestCases/intl402/ch10/10.2/10.2.2_a.js" +}, +{ +"author":"Norbert Lindenberg", +"code":"Ly8gQ29weXJpZ2h0IDIwMTMgTW96aWxsYSBDb3Jwb3JhdGlvbi4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KLyoqCiAqIEBkZXNjcmlwdGlvbiBUZXN0cyB0aGF0IEludGwuQ29sbGF0b3Iuc3VwcG9ydGVkTG9jYWxlc09mCiAqICAgICBkb2Vzbid0IGFjY2VzcyBhcmd1bWVudHMgdGhhdCBpdCdzIG5vdCBnaXZlbi4KICogQGF1dGhvciBOb3JiZXJ0IExpbmRlbmJlcmcKICovCgokSU5DTFVERSgidGVzdEludGwuanMiKTsKCnRhaW50RGF0YVByb3BlcnR5KE9iamVjdC5wcm90b3R5cGUsICIxIik7Cm5ldyBJbnRsLkNvbGxhdG9yKCJ1bmQiKTsK", +"commentary":"", +"description":"Tests that Intl.Collator.supportedLocalesOf\n doesn't access arguments that it's not given.", +"path":"TestCases/intl402/ch10/10.2/10.2.2_b.js" }, { "author":"Norbert Lindenberg", @@ -450,7 +471,7 @@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W11bUZyYWN0aW9uRGlnaXRzOwogICAgaWYgKG1pbiAhPT0gZGlnaXRzKSB7CiAgICAgICAgJEVSUk9SKCJEaWRuJ3QgZ2V0IGNvcnJlY3QgbWluaW11bUZyYWN0aW9uRGlnaXRzIGZvciBjdXJyZW5jeSAiICsKICAgICAgICAgICAgY3VycmVuY3kgKyAiOyBleHBlY3RlZCAiICsgZGlnaXRzICsgIiwgZ290ICIgKyBtaW4gKyAiLiIpOwogICAgfQogICAgaWYgKG1heCAhPT0gZGlnaXRzKSB7CiAgICAgICAgJEVSUk9SKCJEaWRuJ3QgZ2V0IGNvcnJlY3QgbWF4aW11bUZyYWN0aW9uRGlnaXRzIGZvciBjdXJyZW5jeSAiICsKICAgICAgICAgICAgY3VycmVuY3kgKyAiOyBleHBlY3RlZCAiICsgZGlnaXRzICsgIiwgZ290ICIgKyBtYXggKyAiLiIpOwogICAgfQp9KTsKCg==", "commentary":"", "description":"Tests that the number of fractional digits is determined correctly for currencies.", "path":"TestCases/intl402/ch11/11.1/11.1.1_20_c.js" @@ -464,6 +485,13 @@ }, { "author":"Norbert Lindenberg", +"code":"Ly8gQ29weXJpZ2h0IDIwMTMgTW96aWxsYSBDb3Jwb3JhdGlvbi4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KLyoqCiAqIEBkZXNjcmlwdGlvbiBUZXN0cyB0aGF0IHRoZSBvcHRpb25zIG1pbmltdW1TaWduaWZpY2FudERpZ2l0cyBhbmQKICogICAgIG1heGltdW1TaWduaWZpY2FudERpZ2l0cyBhcmUgcmVhZCBpbiB0aGUgcmlnaHQgc2VxdWVuY2UuCiAqIEBhdXRob3IgTm9yYmVydCBMaW5kZW5iZXJnCiAqLwoKdmFyIHJlYWQgPSAwOwoKZnVuY3Rpb24gcmVhZE1pbmltdW1TaWduaWZpY2FudERpZ2l0cygpIHsKICAgICsrcmVhZDsKICAgIGlmIChyZWFkID09PSAxKSB7CiAgICAgICAgcmV0dXJuIDA7IC8vIGludmFsaWQgdmFs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IHJlYWQgKyAiLiIpOwp9Cg==", +"commentary":"", +"description":"Tests that the options minimumSignificantDigits and\n maximumSignificantDigits are read in the right sequence.", +"path":"TestCases/intl402/ch11/11.1/11.1.1_32.js" +}, +{ +"author":"Norbert Lindenberg", "code":"Ly8gQ29weXJpZ2h0IDIwMTIgTW96aWxsYSBDb3Jwb3JhdGlvbi4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KLyoqCiAqIEBkZXNjcmlwdGlvbiBUZXN0cyB0aGF0IHRoZSBvcHRpb24gdXNlR3JvdXBpbmcgaXMgcHJvY2Vzc2VkIGNvcnJlY3RseS4KICogQGF1dGhvciBOb3JiZXJ0IExpbmRlbmJlcmcKICovCgokSU5DTFVERSgidGVzdEludGwuanMiKTsKCnRlc3RPcHRpb24oSW50bC5OdW1iZXJGb3JtYXQsICJ1c2VHcm91cGluZyIsICJib29sZWFuIiwgdW5kZWZpbmVkLCB0cnVlKTsKCg==", "commentary":"", "description":"Tests that the option useGrouping is processed correctly.", @@ -485,6 +513,13 @@ }, { "author":"Norbert Lindenberg", +"code":"Ly8gQ29weXJpZ2h0IDIwMTMgTW96aWxsYSBDb3Jwb3JhdGlvbi4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KLyoqCiAqIEBkZXNjcmlwdGlvbiBUZXN0cyB0aGF0IGNvbnN0cnVjdGluZyBhIE51bWJlckZvcm1hdCBkb2Vzbid0IGNyZWF0ZSBvciBtb2RpZnkKICogICAgIHVud2FudGVkIHByb3BlcnRpZXMgb24gdGhlIFJlZ0V4cCBjb25zdHJ1Y3Rvci4KICogQGF1dGhvciBOb3JiZXJ0IExpbmRlbmJlcmcKICovCgokSU5DTFVERSgidGVzdEludGwuanMiKTsKCnRlc3RGb3JVbndhbnRlZFJlZ0V4cENoYW5nZXMoZnVuY3Rpb24gKCkgewogICAgbmV3IEludGwuTnVtYmVyRm9ybWF0KCJkZS1ERS11LW51LWxhdG4iKTsKfSk7Cgp0ZXN0Rm9yVW53YW50ZWRSZWdFeHBDaGFuZ2VzKGZ1bmN0aW9uICgpIHsKICAgIG5ldyBJbnRsLk51bWJlckZvcm1hdCgiZGUtREUtdS1udS1sYXRuIiwge3N0eWxlOiAiY3VycmVuY3kiLCBjdXJyZW5jeTogIkVVUiJ9KTsKfSk7Cg==", +"commentary":"", +"description":"Tests that constructing a NumberFormat doesn't create or modify\n unwanted properties on the RegExp constructor.", +"path":"TestCases/intl402/ch11/11.1/11.1.1_a.js" +}, +{ +"author":"Norbert Lindenberg", "code":"Ly8gQ29weXJpZ2h0IDIwMTIgTW96aWxsYSBDb3Jwb3JhdGlvbi4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KLyoqCiAqIEBkZXNjcmlwdGlvbiBUZXN0cyB0aGF0IGZvciBub24tb2JqZWN0IHZhbHVlcyBwYXNzZWQgYXMgdGhpcyB0byBOdW1iZXJGb3JtYXQgYQogKiB3cmFwcGVyIG9iamVjdCB3aWxsIGJlIGluaXRpYWxpemVkIGFuZCByZXR1cm5lZC4KICogQGF1dGhvciBOb3JiZXJ0IExpbmRlbmJlcmcKICovCgp2YXIgdGhpc1ZhbHVlcyA9IFt0cnVlLCA0MiwgIuWbvemam+WMliJdOwoKdGhpc1ZhbHVlcy5mb3JFYWNoKGZ1bmN0aW9uICh2YWx1ZSkgewogICAgdmFyIGZvcm1hdCA9IEludGwuTnVtYmVyRm9ybWF0LmNhbGwodmFsdWUpOwogICAgLy8gY2hlY2sgdGhhdCB0aGUgcmV0dXJuZWQgb2JqZWN0IGZ1bmN0aW9ucyBhcyBhIG51bWJlciBmb3JtYXQKICAgIHZhciByZWZlcmVuY2VGb3JtYXQgPSBuZXcgSW50bC5OdW1iZXJGb3JtYXQoKTsKICAgIGlmIChJbnRsLk51bWJlckZvcm1hdC5wcm90b3R5cGUuZm9ybWF0LmNhbGwoZm9ybWF0LCAxMi4zNDU2KSAhPT0gcmVmZXJlbmNlRm9ybWF0LmZvcm1hdCgxMi4zNDU2KSkgewogICAgICAgICRFUlJPUigiTnVtYmVyRm9ybWF0IGluaXRpYWxpemVkIGZyb20gIiArIHZhbHVlICsgIiBkb2Vzbid0IGJlaGF2ZSBsaWtlIG5vcm1hbCBudW1iZXIgZm9ybWF0LiIpOwogICAgfQogICAgcmV0dXJuIHRydWU7Cn0pOwoK", "commentary":"", "description":"Tests that for non-object values passed as this to NumberFormat a\nwrapper object will be initialized and returned.", @@ -523,7 +558,14 @@ "code":"Ly8gQ29weXJpZ2h0IDIwMTIgR29vZ2xlIEluYy4gIEFsbCByaWdodHMgcmVzZXJ2ZWQuCi8qKgogKiBAZGVzY3JpcHRpb24gVGVzdHMgdGhhdCBJbnRsLk51bWJlckZvcm1hdCBoYXMgYSBzdXBwb3J0ZWRMb2NhbGVzT2YKICogcHJvcGVydHksIGFuZCBpdCB3b3JrcyBhcyBwbGFubmVkLgogKiBAYXV0aG9yOiBSb296YmVoIFBvdXJuYWRlcgogKi8KCnZhciBkZWZhdWx0TG9jYWxlID0gbmV3IEludGwuTnVtYmVyRm9ybWF0KCkucmVzb2x2ZWRPcHRpb25zKCkubG9jYWxlOwp2YXIgbm90U3VwcG9ydGVkID0gJ3p4eCc7IC8vICJubyBsaW5ndWlzdGljIGNvbnRlbnQiCnZhciByZXF1ZXN0ZWRMb2NhbGVzID0gW2RlZmF1bHRMb2NhbGUsIG5vdFN1cHBvcnRlZF07CiAgICAKdmFyIHN1cHBvcnRlZExvY2FsZXM7CgppZiAoIUludGwuTnVtYmVyRm9ybWF0Lmhhc093blByb3BlcnR5KCdzdXBwb3J0ZWRMb2NhbGVzT2YnKSkgewogICAgJEVSUk9SKCJJbnRsLk51bWJlckZvcm1hdCBkb2Vzbid0IGhhdmUgYSBzdXBwb3J0ZWRMb2NhbGVzT2YgcHJvcGVydHkuIik7Cn0KICAgIApzdXBwb3J0ZWRMb2NhbGVzID0gSW50bC5OdW1iZXJGb3JtYXQuc3VwcG9ydGVkTG9jYWxlc09mKHJlcXVlc3RlZExvY2FsZXMpOwppZiAoc3VwcG9ydGVkTG9jYWxlcy5sZW5ndGggIT09IDEpIHsKICAgICRFUlJPUignVGhlIGxlbmd0aCBvZiBzdXBwb3J0ZWQgbG9jYWxlcyBsaXN0IGlzIG5vdCAxLicpOwp9CiAgICAKaWYgKHN1cHBvcnRlZExvY2FsZXNbMF0gIT09IGRlZmF1bHRMb2NhbGUpIHsKICAgICRFUlJPUignVGhlIGRlZmF1bHQgbG9jYWxlIGlzIG5vdCByZXR1cm5lZCBpbiB0aGUgc3VwcG9ydGVkIGxpc3QuJyk7Cn0KCg==", "commentary":"", "description":"Tests that Intl.NumberFormat has a supportedLocalesOf\nproperty, and it works as planned.", -"path":"TestCases/intl402/ch11/11.2/11.2.2.js" +"path":"TestCases/intl402/ch11/11.2/11.2.2_a.js" +}, +{ +"author":"Norbert Lindenberg", +"code":"Ly8gQ29weXJpZ2h0IDIwMTMgTW96aWxsYSBDb3Jwb3JhdGlvbi4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KLyoqCiAqIEBkZXNjcmlwdGlvbiBUZXN0cyB0aGF0IEludGwuTnVtYmVyRm9ybWF0LnN1cHBvcnRlZExvY2FsZXNPZgogKiAgICAgZG9lc24ndCBhY2Nlc3MgYXJndW1lbnRzIHRoYXQgaXQncyBub3QgZ2l2ZW4uCiAqIEBhdXRob3IgTm9yYmVydCBMaW5kZW5iZXJnCiAqLwoKJElOQ0xVREUoInRlc3RJbnRsLmpzIik7Cgp0YWludERhdGFQcm9wZXJ0eShPYmplY3QucHJvdG90eXBlLCAiMSIpOwpuZXcgSW50bC5OdW1iZXJGb3JtYXQoInVuZCIpOwo=", +"commentary":"", +"description":"Tests that Intl.NumberFormat.supportedLocalesOf\n doesn't access arguments that it's not given.", +"path":"TestCases/intl402/ch11/11.2/11.2.2_b.js" }, { "author":"Norbert Lindenberg", @@ -548,7 +590,7 @@ }, { "author":"Roozbeh Pournader", -"code":"Ly8gQ29weXJpZ2h0IDIwMTIgR29vZ2xlIEluYy4gIEFsbCByaWdodHMgcmVzZX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HRvIG51bWJlcnMuCiAqIEBhdXRob3I6IFJvb3piZWggUG91cm5hZGVyCiAqLwoKdmFyIGZvcm1hdHRlciA9IG5ldyBJbnRsLk51bWJlckZvcm1hdCgpOwp2YXIgdGVzdERhdGEgPSBbdW5kZWZpbmVkLCBudWxsLCB0cnVlLCAnMC42NjY2NjY2Jywge3ZhbHVlT2Y6IGZ1bmN0aW9uICgpIHsgcmV0dXJuICcwLjEyMzQ1NjcnO319XTsKdmFyIG51bWJlcjsKdmFyIGksIGlucHV0LCBjb3JyZWN0UmVzdWx0LCByZXN1bHQ7Cgpmb3IgKGkgaW4gdGVzdERhdGEpIHsKICAgIGlucHV0ID0gdGVzdERhdGFbaV07CiAgICBudW1iZXIgPSAraW5wdXQ7CiAgICBjb3JyZWN0UmVzdWx0ID0gZm9ybWF0dGVyLmZvcm1hdChudW1iZXIpOwogICAgCiAgICByZXN1bHQgPSBmb3JtYXR0ZXIuZm9ybWF0KGlucHV0KTsKICAgIGlmIChyZXN1bHQgIT09IGNvcnJlY3RSZXN1bHQpIHsKICAgICAgICAkRVJST1IoJ0ludGwuTnVtYmVyRm9ybWF0IGRvZXMgbm90IGNvbnZlcnQgb3RoZXIgJyArCiAgICAgICAgICAgICd0eXBlcyB0byBudW1iZXJzLiBJbnB1dDogIicraW5wdXQrJyIgT3V0cHV0OiAiJytyZXN1bHQrJyIgJysKICAgICAgICAgICAgJ0V4cGVjdGVkIG91dHB1dDogIicrY29ycmVjdFJlc3VsdCsnIicpOwogICAgfQp9Cgo=", "commentary":"", "description":"Tests that Intl.NumberFormat.prototype.format\nconverts other types to numbers.", "path":"TestCases/intl402/ch11/11.3/11.3.2_1_a_ii.js" @@ -709,6 +751,13 @@ }, { "author":"Norbert Lindenberg", +"code":"Ly8gQ29weXJpZ2h0IDIwMTMgTW96aWxsYSBDb3Jwb3JhdGlvbi4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KLyoqCiAqIEBkZXNjcmlwdGlvbiBUZXN0cyB0aGF0IGNvbnN0cnVjdGluZyBhIERhdGVUaW1lRm9ybWF0IGRvZXNuJ3QgY3JlYXRlIG9yIG1vZGlmeQogKiAgICAgdW53YW50ZWQgcHJvcGVydGllcyBvbiB0aGUgUmVnRXhwIGNvbnN0cnVjdG9yLgogKiBAYXV0aG9yIE5vcmJlcnQgTGluZGVuYmVyZwogKi8KCiRJTkNMVURFKCJ0ZXN0SW50bC5qcyIpOwoKdGVzdEZvclVud2FudGVkUmVnRXhwQ2hhbmdlcyhmdW5jdGlvbiAoKSB7CiAgICBuZXcgSW50bC5EYXRlVGltZUZvcm1hdCgiZGUtREUtdS1jYS1ncmVnb3J5Iik7Cn0pOwoKdGVzdEZvclVud2FudGVkUmVnRXhwQ2hhbmdlcyhmdW5jdGlvbiAoKSB7CiAgICBuZXcgSW50bC5EYXRlVGltZUZvcm1hdCgiZGUtREUtdS1jYS1ncmVnb3J5Iiwge3RpbWVab25lOiAiVVRDIn0pOwp9KTsK", +"commentary":"", +"description":"Tests that constructing a DateTimeFormat doesn't create or modify\n unwanted properties on the RegExp constructor.", +"path":"TestCases/intl402/ch12/12.1/12.1.1_a.js" +}, +{ +"author":"Norbert Lindenberg", "code":"Ly8gQ29weXJpZ2h0IDIwMTIgTW96aWxsYSBDb3Jwb3JhdGlvbi4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KLyoqCiAqIEBkZXNjcmlwdGlvbiBUZXN0cyB0aGF0IHRoZSBzZXQgb2Ygb3B0aW9ucyBmb3IgdGhlIGRhdGUgYW5kIHRpbWUgY29tcG9uZW50cyBpcyBwcm9jZXNzZWQgY29ycmVjdGx5LgogKiBAYXV0aG9yIE5vcmJlcnQgTGluZGVuYmVyZwogKi8KCiRJTkNMVURFKCJ0ZXN0SW50bC5qcyIpOwoKdmFyIGxvY2FsZXMgPSBbW10sIFsiemgtSGFucy1DTiJdLCBbImhpLUlOIl0sIFsiZW4tVVMiXSwgWyJpZC1JRCJdXTsKdmFyIGRhdGVzID0gW25ldyBEYXRlKCksIG5ldyBEYXRlKDApLCBuZXcgRGF0ZShEYXRlLnBhcnNlKCIxOTg5LTExLTA5VDE3OjU3OjAwWiIpKV07CgpmdW5jdGlvbiB0ZXN0V2l0aERhdGVUaW1lRm9ybWF0KG9wdGlvbnMsIGV4cGVjdGVkKSB7CiAgICBsb2NhbGVzLmZvckVhY2goZnVuY3Rpb24gKGxvY2FsZXMpIHsKICAgICAgICB2YXIgZm9ybWF0ID0gbmV3IEludGwuRGF0ZVRpbWVGb3JtYXQobG9jYWxlcywgb3B0aW9ucyk7CiAgICAgICAgdmFyIHJlc29sdmVkT3B0aW9ucyA9IGZvcm1hdC5yZXNvbHZlZE9wdGlvbnMoKTsKICAgICAgICBnZXREYXRlVGltZUNvbXBvbmVudHMoKS5mb3JFYWNoKGZ1bmN0aW9uIChjb21wb25lbnQpIHsKICAgICAgICAgICAgaWYgKHJlc29sdmVkT3B0aW9ucy5oYXNPd25Qcm9wZXJ0eShjb21wb25lbnQpKSB7CiAgICAgICAgICAgICAgICBpZiAoIWV4cGVjdGVkLmhhc093blByb3BlcnR5KGNvbXBvbmVudCkpIHsKICAgICAgICAgICAgICAgICAgICAkRVJST1IoIlVucmVxdWVzdGVkIGNvbXBvbmVudCAiICsgY29tcG9uZW50ICsKICAgICAgICAgICAgICAgICAgICAgICAgIiBhZGRlZCB0byBleHBlY3RlZCBzdWJzZXQgIiArIEpTT04uc3RyaW5naWZ5KGV4cGVjdGVkKSArCiAgICAgICAgICAgICAgICAgICAgICAgICI7IGxvY2FsZXMgIiArIGxvY2FsZXMgKyAiLCBvcHRpb25zICIgKwogICAgICAgICAgICAgICAgICAgICAgICAob3B0aW9ucyA/IEpTT04uc3RyaW5naWZ5KG9wdGlvbnMpIDogb3B0aW9ucykgKyAiLiIpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgaWYgKGV4cGVjdGVkLmhhc093blByb3BlcnR5KGNvbXBvbmVudCkpIHsKICAgICAgICA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gc2Vjb25kOiAibnVtZXJpYyJ9KTsKCi8vIHRpbWUvdGltZTogc3RlcHMgNmEsIDhhCnRlc3RXaXRoVG9Mb2NhbGUoInRvTG9jYWxlVGltZVN0cmluZyIsIHt3ZWVrZGF5OiAic2hvcnQiLCB5ZWFyOiAibnVtZXJpYyIsIG1vbnRoOiAibnVtZXJpYyIsIGRheTogIm51bWVyaWMifSwKICAgIHt3ZWVrZGF5OiAic2hvcnQiLCB5ZWFyOiAibnVtZXJpYyIsIG1vbnRoOiAibnVtZXJpYyIsIGRheTogIm51bWVyaWMiLCBob3VyOiAibnVtZXJpYyIsIG1pbnV0ZTogIm51bWVyaWMiLCBzZWNvbmQ6ICJudW1lcmljIn0pOwoKLy8gdGltZS90aW1lOiBzdGVwcyA2YQp0ZXN0V2l0aFRvTG9jYWxlKCJ0b0xvY2FsZVRpbWVTdHJpbmciLCB7aG91cjogIm51bWVyaWMiLCBtaW51dGU6ICJudW1lcmljIn0sIHtob3VyOiAibnVtZXJpYyIsIG1pbnV0ZTogIm51bWVyaWMifSk7CgoK", "commentary":"", "description":"Tests that the set of options for the date and time components is processed correctly.", @@ -754,7 +803,14 @@ "code":"Ly8gQ29weXJpZ2h0IDIwMTIgR29vZ2xlIEluYy4gIEFsbCByaWdodHMgcmVzZXJ2ZWQuCi8qKgogKiBAZGVzY3JpcHRpb24gVGVzdHMgdGhhdCBJbnRsLkRhdGVUaW1lRm9ybWF0IGhhcyBhIHN1cHBvcnRlZExvY2FsZXNPZgogKiBwcm9wZXJ0eSwgYW5kIGl0IHdvcmtzIGFzIHBsYW5uZWQuCiAqIEBhdXRob3I6IFJvb3piZWggUG91cm5hZGVyCiAqLwoKdmFyIGRlZmF1bHRMb2NhbGUgPSBuZXcgSW50bC5EYXRlVGltZUZvcm1hdCgpLnJlc29sdmVkT3B0aW9ucygpLmxvY2FsZTsKdmFyIG5vdFN1cHBvcnRlZCA9ICd6eHgnOyAvLyAibm8gbGluZ3Vpc3RpYyBjb250ZW50Igp2YXIgcmVxdWVzdGVkTG9jYWxlcyA9IFtkZWZhdWx0TG9jYWxlLCBub3RTdXBwb3J0ZWRdOwogICAgCnZhciBzdXBwb3J0ZWRMb2NhbGVzOwoKaWYgKCFJbnRsLkRhdGVUaW1lRm9ybWF0Lmhhc093blByb3BlcnR5KCdzdXBwb3J0ZWRMb2NhbGVzT2YnKSkgewogICAgJEVSUk9SKCJJbnRsLkRhdGVUaW1lRm9ybWF0IGRvZXNuJ3QgaGF2ZSBhIHN1cHBvcnRlZExvY2FsZXNPZiBwcm9wZXJ0eS4iKTsKfQogICAgCnN1cHBvcnRlZExvY2FsZXMgPSBJbnRsLkRhdGVUaW1lRm9ybWF0LnN1cHBvcnRlZExvY2FsZXNPZihyZXF1ZXN0ZWRMb2NhbGVzKTsKaWYgKHN1cHBvcnRlZExvY2FsZXMubGVuZ3RoICE9PSAxKSB7CiAgICAkRVJST1IoJ1RoZSBsZW5ndGggb2Ygc3VwcG9ydGVkIGxvY2FsZXMgbGlzdCBpcyBub3QgMS4nKTsKfQogICAgCmlmIChzdXBwb3J0ZWRMb2NhbGVzWzBdICE9PSBkZWZhdWx0TG9jYWxlKSB7CiAgICAkRVJST1IoJ1RoZSBkZWZhdWx0IGxvY2FsZSBpcyBub3QgcmV0dXJuZWQgaW4gdGhlIHN1cHBvcnRlZCBsaXN0LicpOwp9Cgo=", "commentary":"", "description":"Tests that Intl.DateTimeFormat has a supportedLocalesOf\nproperty, and it works as planned.", -"path":"TestCases/intl402/ch12/12.2/12.2.2.js" +"path":"TestCases/intl402/ch12/12.2/12.2.2_a.js" +}, +{ +"author":"Norbert Lindenberg", +"code":"Ly8gQ29weXJpZ2h0IDIwMTMgTW96aWxsYSBDb3Jwb3JhdGlvbi4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KLyoqCiAqIEBkZXNjcmlwdGlvbiBUZXN0cyB0aGF0IEludGwuRGF0ZVRpbWVGb3JtYXQuc3VwcG9ydGVkTG9jYWxlc09mCiAqICAgICBkb2Vzbid0IGFjY2VzcyBhcmd1bWVudHMgdGhhdCBpdCdzIG5vdCBnaXZlbi4KICogQGF1dGhvciBOb3JiZXJ0IExpbmRlbmJlcmcKICovCgokSU5DTFVERSgidGVzdEludGwuanMiKTsKCnRhaW50RGF0YVByb3BlcnR5KE9iamVjdC5wcm90b3R5cGUsICIxIik7Cm5ldyBJbnRsLkRhdGVUaW1lRm9ybWF0KCJ1bmQiKTsK", +"commentary":"", +"description":"Tests that Intl.DateTimeFormat.supportedLocalesOf\n doesn't access arguments that it's not given.", +"path":"TestCases/intl402/ch12/12.2/12.2.2_b.js" }, { "author":"Norbert Lindenberg", @@ -901,7 +957,14 @@ "code":"Ly8gQ29weXJpZ2h0IDIwMTIgTW96aWxsYSBDb3Jwb3JhdGlvbi4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KLyoqCiAqIEBkZXNjcmlwdGlvbiBUZXN0cyB0aGF0IFN0cmluZy5wcm90b3R5cGUubG9jYWxlQ29tcGFyZSB0aHJvd3MgdGhlIHNhbWUgZXhjZXB0aW9ucyBhcyBJbnRsLkNvbGxhdG9yLgogKiBAYXV0aG9yIE5vcmJlcnQgTGluZGVuYmVyZwogKi8KCnZhciBsb2NhbGVzID0gW251bGwsIFtOYU5dLCBbImkiXSwgWyJkZV9ERSJdXTsKdmFyIG9wdGlvbnMgPSBbCiAgICB7bG9jYWxlTWF0Y2hlcjogbnVsbH0sCiAgICB7dXNhZ2U6ICJpbnZhbGlkIn0sCiAgICB7c2Vuc2l0aXZpdHk6ICJpbnZhbGlkIn0KXTsKCmxvY2FsZXMuZm9yRWFjaChmdW5jdGlvbiAobG9jYWxlcykgewogICAgdmFyIHJlZmVyZW5jZUVycm9yLCBlcnJvcjsKICAgIHRyeSB7CiAgICAgICAgdmFyIGNvbGxhdG9yID0gbmV3IEludGwuQ29sbGF0b3IobG9jYWxlcyk7CiAgICB9IGNhdGNoIChlKSB7CiAgICAgICAgcmVmZXJlbmNlRXJyb3IgPSBlOwogICAgfQogICAgaWYgKHJlZmVyZW5jZUVycm9yID09PSB1bmRlZmluZWQpIHsKICAgICAgICAkRVJST1IoIkludGVybmFsIGVycm9yOiBFeHBlY3RlZCBleGNlcHRpb24gd2FzIG5vdCB0aHJvd24gYnkgSW50bC5Db2xsYXRvciBmb3IgbG9jYWxlcyAiICsgbG9jYWxlcyArICIuIik7CiAgICB9CiAgICAKICAgIHRyeSB7CiAgICAgICAgdmFyIHJlc3VsdCA9ICIiLmxvY2FsZUNvbXBhcmUoIiIsIGxvY2FsZXMpOwogICAgfSBjYXRjaCAoZSkgewogICAgICAgIGVycm9yID0gZTsKICAgIH0KICAgIGlmIChlcnJvciA9PT0gdW5kZWZpbmVkKSB7CiAgICAgICAgJEVSUk9SKCJTdHJpbmcucHJvdG90eXBlLmxvY2FsZUNvbXBhcmUgZGlkbid0IHRocm93IGV4Y2VwdGlvbiBmb3IgbG9jYWxlcyAiICsgbG9jYWxlcyArICIuIik7CiAgICB9IGVsc2UgaWYgKGVycm9yLm5hbWUgIT09IHJlZmVyZW5jZUVycm9yLm5hbWUpIHsKICAgICAgICAkRVJST1IoIlN0cmluZy5wcm90b3R5cGUubG9jYWxlQ29tcGFyZSB0aHJldyBleGNlcHRpb24gIiArIGVycm9yLm5hbWUgKwogICAgICAgICAgICAiIGZvciBsb2NhbGVzICIgKyBsb2NhbGVzICsgIjsgZXhwZWN0ZWQgIiArIHJlZmVyZW5jZUVycm9yLm5hbWUgKyAiLiIpOwogICAgfQp9KTsKCm9wdGlvbnMuZm9yRWFjaChmdW5jdGlvbiAob3B0aW9ucykgewogICAgdmFyIHJlZmVyZW5jZUVycm9yLCBlcnJvcjsKICAgIHRyeSB7CiAgICAgICAgdmFyIGNvbGxhdG9yID0gbmV3IEludGwuQ29sbGF0b3IoW10sIG9wdGlvbnMpOwogICAgfSBjYXRjaCAoZSkgewogICAgICAgIHJlZmVyZW5jZUVycm9yID0gZTsKICAgIH0KICAgIGlmIChyZWZlcmVuY2VFcnJvciA9PT0gdW5kZWZpbmVkKSB7CiAgICAgICAgJEVSUk9SKCJJbnRlcm5hbCBlcnJvcjogRXhwZWN0ZWQgZXhjZXB0aW9uIHdhcyBub3QgdGhyb3duIGJ5IEludGwuQ29sbGF0b3IgZm9yIG9wdGlvbnMgIiArCiAgICAgICAgICAgIEpTT04uc3RyaW5naWZ5KG9wdGlvbnMpICsgIi4iKTsKICAgIH0KICAgIAogICAgdHJ5IHsKICAgICAgICB2YXIgcmVzdWx0ID0gIiIubG9jYWxlQ29tcGFyZSgiIiwgW10sIG9wdGlvbnMpOwogICAgfSBjYXRjaCAoZSkgewogICAgICAgIGVycm9yID0gZTsKICAgIH0KICAgIGlmIChlcnJvciA9PT0gdW5kZWZpbmVkKSB7CiAgICAgICAgJEVSUk9SKCJTdHJpbmcucHJvdG90eXBlLmxvY2FsZUNvbXBhcmUgZGlkbid0IHRocm93IGV4Y2VwdGlvbiBmb3Igb3B0aW9ucyAiICsKICAgICAgICAgICAgSlNPTi5zdHJpbmdpZnkob3B0aW9ucykgKyAiLiIpOwogICAgfSBlbHNlIGlmIChlcnJvci5uYW1lICE9PSByZWZlcmVuY2VFcnJvci5uYW1lKSB7CiAgICAgICAgJEVSUk9SKCJTdHJpbmcucHJvdG90eXBlLmxvY2FsZUNvbXBhcmUgdGhyZXcgZXhjZXB0aW9uICIgKyBlcnJvci5uYW1lICsKICAgICAgICAgICAgIiBmb3Igb3B0aW9ucyAiICsgSlNPTi5zdHJpbmdpZnkob3B0aW9ucykgKyAiOyBleHBlY3RlZCAiICsgcmVmZXJlbmNlRXJyb3IubmFtZSArICIuIik7CiAgICB9Cn0pOwoK", "commentary":"", "description":"Tests that String.prototype.localeCompare throws the same exceptions as Intl.Collator.", -"path":"TestCases/intl402/ch13/13.1/13.1.1_6.js" +"path":"TestCases/intl402/ch13/13.1/13.1.1_6_1.js" +}, +{ +"author":"Norbert Lindenberg", +"code":"Ly8gQ29weXJpZ2h0IDIwMTMgTW96aWxsYSBDb3Jwb3JhdGlvbi4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KLyoqCiAqIEBkZXNjcmlwdGlvbiBUZXN0cyB0aGF0IFN0cmluZy5wcm90b3R5cGUubG9jYWxlQ29tcGFyZSB1c2VzIHRoZSBzdGFuZGFyZAogKiAgICAgYnVpbHQtaW4gSW50bC5Db2xsYXRvciBjb25zdHJ1Y3Rvci4KICogQGF1dGhvciBOb3JiZXJ0IExpbmRlbmJlcmcKICovCgokSU5DTFVERSgidGVzdEludGwuanMiKTsKCnRhaW50RGF0YVByb3BlcnR5KEludGwsICJDb2xsYXRvciIpOwoiYSIubG9jYWxlQ29tcGFyZSgiYiIpOwo=", +"commentary":"", +"description":"Tests that String.prototype.localeCompare uses the standard\n built-in Intl.Collator constructor.", +"path":"TestCases/intl402/ch13/13.1/13.1.1_6_2.js" }, { "author":"Norbert Lindenberg", @@ -929,7 +992,14 @@ "code":"Ly8gQ29weXJpZ2h0IDIwMTIgTW96aWxsYSBDb3Jwb3JhdGlvbi4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KLyoqCiAqIEBkZXNjcmlwdGlvbiBUZXN0cyB0aGF0IE51bWJlci5wcm90b3R5cGUudG9Mb2NhbGVTdHJpbmcgdGhyb3dzIHRoZSBzYW1lIGV4Y2VwdGlvbnMgYXMgSW50bC5OdW1iZXJGb3JtYXQuCiAqIEBhdXRob3IgTm9yYmVydCBMaW5kZW5iZXJnCiAqLwoKdmFyIGxvY2FsZXMgPSBbbnVsbCwgW05hTl0sIFsiaSJdLCBbImRlX0RFIl1dOwp2YXIgb3B0aW9ucyA9IFsKICAgIHtsb2NhbGVNYXRjaGVyOiBudWxsfSwKICAgIHtzdHlsZTogImludmFsaWQifSwKICAgIHtzdHlsZTogImN1cnJlbmN5In0sCiAgICB7c3R5bGU6ICJjdXJyZW5jeSIsIGN1cnJlbmN5OiAiw59QIn0sCiAgICB7bWF4aW11bVNpZ25pZmljYW50RGlnaXRzOiAtSW5maW5pdHl9Cl07Cgpsb2NhbGVzLmZvckVhY2goZnVuY3Rpb24gKGxvY2FsZXMpIHsKICAgIHZhciByZWZlcmVuY2VFcnJvciwgZXJyb3I7CiAgICB0cnkgewogICAgICAgIHZhciBmb3JtYXQgPSBuZXcgSW50bC5OdW1iZXJGb3JtYXQobG9jYWxlcyk7CiAgICB9IGNhdGNoIChlKSB7CiAgICAgICAgcmVmZXJlbmNlRXJyb3IgPSBlOwogICAgfQogICAgaWYgKHJlZmVyZW5jZUVycm9yID09PSB1bmRlZmluZWQpIHsKICAgICAgICAkRVJST1IoIkludGVybmFsIGVycm9yOiBFeHBlY3RlZCBleGNlcHRpb24gd2FzIG5vdCB0aHJvd24gYnkgSW50bC5OdW1iZXJGb3JtYXQgZm9yIGxvY2FsZXMgIiArIGxvY2FsZXMgKyAiLiIpOwogICAgfQogICAgCiAgICB0cnkgewogICAgICAgIHZhciByZXN1bHQgPSAoMCkudG9Mb2NhbGVTdHJpbmcobG9jYWxlcyk7CiAgICB9IGNhdGNoIChlKSB7CiAgICAgICAgZXJyb3IgPSBlOwogICAgfQogICAgaWYgKGVycm9yID09PSB1bmRlZmluZWQpIHsKICAgICAgICAkRVJST1IoIk51bWJlci5wcm90b3R5cGUudG9Mb2NhbGVTdHJpbmcgZGlkbid0IHRocm93IGV4Y2VwdGlvbiBmb3IgbG9jYWxlcyAiICsgbG9jYWxlcyArICIuIik7CiAgICB9IGVsc2UgaWYgKGVycm9yLm5hbWUgIT09IHJlZmVyZW5jZUVycm9yLm5hbWUpIHsKICAgICAgICAkRVJST1IoIk51bWJlci5wcm90b3R5cGUudG9Mb2NhbGVTdHJpbmcgdGhyZXcgZXhjZXB0aW9uICIgKyBlcnJvci5uYW1lICsKICAgICAgICAgICAgIiBmb3IgbG9jYWxlcyAiICsgbG9jYWxlcyArICI7IGV4cGVjdGVkICIgKyByZWZlcmVuY2VFcnJvci5uYW1lICsgIi4iKTsKICAgIH0KfSk7CgpvcHRpb25zLmZvckVhY2goZnVuY3Rpb24gKG9wdGlvbnMpIH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UgKyAiLiIpOwogICAgfQp9KTsKCg==", "commentary":"", "description":"Tests that Number.prototype.toLocaleString throws the same exceptions as Intl.NumberFormat.", -"path":"TestCases/intl402/ch13/13.2/13.2.1_4.js" +"path":"TestCases/intl402/ch13/13.2/13.2.1_4_1.js" +}, +{ +"author":"Norbert Lindenberg", +"code":"Ly8gQ29weXJpZ2h0IDIwMTMgTW96aWxsYSBDb3Jwb3JhdGlvbi4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KLyoqCiAqIEBkZXNjcmlwdGlvbiBUZXN0cyB0aGF0IE51bWJlci5wcm90b3R5cGUudG9Mb2NhbGVTdHJpbmcgdXNlcyB0aGUgc3RhbmRhcmQKICogICAgIGJ1aWx0LWluIEludGwuTnVtYmVyRm9ybWF0IGNvbnN0cnVjdG9yLgogKiBAYXV0aG9yIE5vcmJlcnQgTGluZGVuYmVyZwogKi8KCiRJTkNMVURFKCJ0ZXN0SW50bC5qcyIpOwoKdGFpbnREYXRhUHJvcGVydHkoSW50bCwgIk51bWJlckZvcm1hdCIpOwooMC4wKS50b0xvY2FsZVN0cmluZygpOwo=", +"commentary":"", +"description":"Tests that Number.prototype.toLocaleString uses the standard\n built-in Intl.NumberFormat constructor.", +"path":"TestCases/intl402/ch13/13.2/13.2.1_4_2.js" }, { "author":"Norbert Lindenberg", @@ -964,7 +1034,14 @@ "code":"Ly8gQ29weXJpZ2h0IDIwMTIgTW96aWxsYSBDb3Jwb3JhdGlvbi4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KLyoqCiAqIEBkZXNjcmlwdGlvbiBUZXN0cyB0aGF0IERhdGUucHJvdG90eXBlLnRvTG9jYWxlU3RyaW5nICYgQ28uIHRocm93cyB0aGUgc2FtZSBleGNlcHRpb25zIGFzIEludGwuRGF0ZVRpbWVGb3JtYXQuCiAqIEBhdXRob3IgTm9yYmVydCBMaW5kZW5iZXJnCiAqLwoKdmFyIGZ1bmN0aW9ucyA9IHsKICAgIHRvTG9jYWxlU3RyaW5nOi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AgICAgICB2YXIgcmVzdWx0ID0gZi5jYWxsKG5ldyBEYXRlKCksIGxvY2FsZXMpOwogICAgICAgIH0gY2F0Y2ggKGUpIHsKICAgICAgICAgICAgZXJyb3IgPSBlOwogICAgICAgIH0KICAgICAgICBpZiAoZXJyb3IgPT09IHVuZGVmaW5lZCkgewogICAgICAgICAgICAkRVJST1IoIkRhdGUucHJvdG90eXBlLiIgKyBwICsgIiBkaWRuJ3QgdGhyb3cgZXhjZXB0aW9uIGZvciBsb2NhbGVzICIgKyBsb2NhbGVzICsgIi4iKTsKICAgICAgICB9IGVsc2UgaWYgKGVycm9yLm5hbWUgIT09IHJlZmVyZW5jZUVycm9yLm5hbWUpIHsKICAgICAgICAgICAgJEVSUk9SKCJEYXRlLnByb3RvdHlwZS4iICsgcCArICIgdGhyZXcgZXhjZXB0aW9uICIgKyBlcnJvci5uYW1lICsKICAgICAgICAgICAgICAgICIgZm9yIGxvY2FsZXMgIiArIGxvY2FsZXMgKyAiOyBleHBlY3RlZCAiICsgcmVmZXJlbmNlRXJyb3IubmFtZSArICIuIik7CiAgICAgICAgfQogICAgfSk7CiAgICAKICAgIG9wdGlvbnMuZm9yRWFjaChmdW5jdGlvbiAob3B0aW9ucykgewogICAgICAgIHZhciByZWZlcmVuY2VFcnJvciwgZXJyb3I7CiAgICAgICAgdHJ5IHsKICAgICAgICAgICAgdmFyIGZvcm1hdCA9IG5ldyBJbnRsLkRhdGVUaW1lRm9ybWF0KFtdLCBvcHRpb25zKTsKICAgICAgICB9IGNhdGNoIChlKSB7CiAgICAgICAgICAgIHJlZmVyZW5jZUVycm9yID0gZTsKICAgICAgICB9CiAgICAgICAgaWYgKHJlZmVyZW5jZUVycm9yID09PSB1bmRlZmluZWQpIHsKICAgICAgICAgICAgJEVSUk9SKCJJbnRlcm5hbCBlcnJvcjogRXhwZWN0ZWQgZXhjZXB0aW9uIHdhcyBub3QgdGhyb3duIGJ5IEludGwuRGF0ZVRpbWVGb3JtYXQgZm9yIG9wdGlvbnMgIiArCiAgICAgICAgICAgICAgICBKU09OLnN0cmluZ2lmeShvcHRpb25zKSArICIuIik7CiAgICAgICAgfQogICAgICAgIAogICAgICAgIHRyeSB7CiAgICAgICAgICAgIHZhciByZXN1bHQgPSBmLmNhbGwobmV3IERhdGUoKSwgW10sIG9wdGlvbnMpOwogICAgICAgIH0gY2F0Y2ggKGUpIHsKICAgICAgICAgICAgZXJyb3IgPSBlOwogICAgICAgIH0KICAgICAgICBpZiAoZXJyb3IgPT09IHVuZGVmaW5lZCkgewogICAgICAgICAgICAkRVJST1IoIkRhdGUucHJvdG90eXBlLiIgKyBwICsgIiBkaWRuJ3QgdGhyb3cgZXhjZXB0aW9uIGZvciBvcHRpb25zICIgKwogICAgICAgICAgICAgICAgSlNPTi5zdHJpbmdpZnkob3B0aW9ucykgKyAiLiIpOwogICAgICAgIH0gZWxzZSBpZiAoZXJyb3IubmFtZSAhPT0gcmVmZXJlbmNlRXJyb3IubmFtZSkgewogICAgICAgICAgICAkRVJST1IoIkRhdGUucHJvdG90eXBlLiIgKyBwICsgIiB0aHJldyBleGNlcHRpb24gIiArIGVycm9yLm5hbWUgKwogICAgICAgICAgICAgICAgIiBmb3Igb3B0aW9ucyAiICsgSlNPTi5zdHJpbmdpZnkob3B0aW9ucykgKyAiOyBleHBlY3RlZCAiICsgcmVmZXJlbmNlRXJyb3IubmFtZSArICIuIik7CiAgICAgICAgfQogICAgfSk7Cn0pOwoK", "commentary":"", "description":"Tests that Date.prototype.toLocaleString & Co. throws the same exceptions as Intl.DateTimeFormat.", -"path":"TestCases/intl402/ch13/13.3/13.3.0_6.js" +"path":"TestCases/intl402/ch13/13.3/13.3.0_6_1.js" +}, +{ +"author":"Norbert Lindenberg", +"code":"Ly8gQ29weXJpZ2h0IDIwMTMgTW96aWxsYSBDb3Jwb3JhdGlvbi4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KLyoqCiAqIEBkZXNjcmlwdGlvbiBUZXN0cyB0aGF0IERhdGUucHJvdG90eXBlLnRvTG9jYWxlU3RyaW5nICYgQ28uIHVzZSB0aGUgc3RhbmRhcmQKICogICAgIGJ1aWx0LWluIEludGwuRGF0ZVRpbWVGb3JtYXQgY29uc3RydWN0b3IuCiAqIEBhdXRob3IgTm9yYmVydCBMaW5kZW5iZXJnCiAqLwoKJElOQ0xVREUoInRlc3RJbnRsLmpzIik7Cgp0YWludERhdGFQcm9wZXJ0eShJbnRsLCAiRGF0ZVRpbWVGb3JtYXQiKTsKbmV3IERhdGUoKS50b0xvY2FsZVN0cmluZygpOwpuZXcgRGF0ZSgpLnRvTG9jYWxlRGF0ZVN0cmluZygpOwpuZXcgRGF0ZSgpLnRvTG9jYWxlVGltZVN0cmluZygpOwo=", +"commentary":"", +"description":"Tests that Date.prototype.toLocaleString & Co. use the standard\n built-in Intl.DateTimeFormat constructor.", +"path":"TestCases/intl402/ch13/13.3/13.3.0_6_2.js" }, { "author":"Norbert Lindenberg", diff --git a/website/json/suiteDescrip.json b/website/json/suiteDescrip.json index 9869a8b687..4b5169c047 100644 --- a/website/json/suiteDescrip.json +++ b/website/json/suiteDescrip.json @@ -1 +1 @@ -{"date":"2013-02-07","version":"ES5.1"} \ No newline at end of file +{"date":"2013-03-24","version":"ES5.1"} \ No newline at end of file diff --git a/website/json/testcases_intl402.json b/website/json/testcases_intl402.json index 06df8f99dc..fb6790bf59 100644 --- a/website/json/testcases_intl402.json +++ b/website/json/testcases_intl402.json @@ -1,5 +1,5 @@ { -"numTests":142, +"numTests":153, "testSuite":[ "json/intl402.json" ]