diff --git a/js/src/tests/test262/GIT-INFO b/js/src/tests/test262/GIT-INFO index ef851b6ba366..43cc8c0a379e 100644 --- a/js/src/tests/test262/GIT-INFO +++ b/js/src/tests/test262/GIT-INFO @@ -1,6 +1,7 @@ -commit 2726142bb97e4538703eda748c3b7300183bc66d -Author: test262-automation -Date: Wed Nov 14 19:00:37 2018 +0000 +commit 8e3c6d048449a2e47c7748eafa350f49c0b8b7bc +Author: Leo Balter +Date: Mon Dec 10 10:59:09 2018 -0500 - [v8-test262-automation] Updated curation log with latest revision sha's from export and changed files. - sourceRevisionAtLastExport: ac250b9b targetRevisionAtLastExport: 6218e682b2 + Merge pull request #1987 from test262-automation/v8-test262-automation-export-07b313100e + + Import test changes from V8 diff --git a/js/src/tests/test262/built-ins/Array/prototype/flat/non-object-ctor-throws.js b/js/src/tests/test262/built-ins/Array/prototype/flat/non-object-ctor-throws.js index 806ad425dd1b..fe6886dcc1c6 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/flat/non-object-ctor-throws.js +++ b/js/src/tests/test262/built-ins/Array/prototype/flat/non-object-ctor-throws.js @@ -8,6 +8,8 @@ description: > features: [Array.prototype.flat] ---*/ +assert.sameValue(typeof Array.prototype.flat, 'function'); + var a = []; a.constructor = null; assert.throws(TypeError, function() { diff --git a/js/src/tests/test262/built-ins/Array/prototype/flat/null-undefined-input-throws.js b/js/src/tests/test262/built-ins/Array/prototype/flat/null-undefined-input-throws.js index 6c6ddae7c50b..aac2ff3346eb 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/flat/null-undefined-input-throws.js +++ b/js/src/tests/test262/built-ins/Array/prototype/flat/null-undefined-input-throws.js @@ -7,6 +7,8 @@ description: > features: [Array.prototype.flat] ---*/ +assert.sameValue(typeof Array.prototype.flat, 'function'); + assert.throws(TypeError, function() { [].flat.call(null); }, 'null value'); diff --git a/js/src/tests/test262/built-ins/Array/prototype/flat/symbol-object-create-null-depth-throws.js b/js/src/tests/test262/built-ins/Array/prototype/flat/symbol-object-create-null-depth-throws.js index 57de25004200..a84a154d6a23 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/flat/symbol-object-create-null-depth-throws.js +++ b/js/src/tests/test262/built-ins/Array/prototype/flat/symbol-object-create-null-depth-throws.js @@ -7,6 +7,8 @@ description: > features: [Array.prototype.flat] ---*/ +assert.sameValue(typeof Array.prototype.flat, 'function'); + assert.throws(TypeError, function() { [].flat(Symbol()); }, 'symbol value'); diff --git a/js/src/tests/test262/built-ins/Array/prototype/flatMap/non-callable-argument-throws.js b/js/src/tests/test262/built-ins/Array/prototype/flatMap/non-callable-argument-throws.js index e2bd899d0206..6d1d601799ac 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/flatMap/non-callable-argument-throws.js +++ b/js/src/tests/test262/built-ins/Array/prototype/flatMap/non-callable-argument-throws.js @@ -7,6 +7,8 @@ description: > features: [Array.prototype.flatMap] ---*/ +assert.sameValue(typeof Array.prototype.flatMap, "function"); + assert.throws(TypeError, function() { [].flatMap({}); }, 'non callable argument'); diff --git a/js/src/tests/test262/built-ins/Array/prototype/flatMap/non-object-ctor-throws.js b/js/src/tests/test262/built-ins/Array/prototype/flatMap/non-object-ctor-throws.js index bf693812eab5..c21719cff1b5 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/flatMap/non-object-ctor-throws.js +++ b/js/src/tests/test262/built-ins/Array/prototype/flatMap/non-object-ctor-throws.js @@ -8,6 +8,8 @@ description: > features: [Array.prototype.flatMap] ---*/ +assert.sameValue(typeof Array.prototype.flatMap, 'function'); + var a = []; a.constructor = null; assert.throws(TypeError, function() { diff --git a/js/src/tests/test262/built-ins/Array/prototype/flatMap/null-undefined-input-throws.js b/js/src/tests/test262/built-ins/Array/prototype/flatMap/null-undefined-input-throws.js index f9a18be40fef..182fd4cb28b8 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/flatMap/null-undefined-input-throws.js +++ b/js/src/tests/test262/built-ins/Array/prototype/flatMap/null-undefined-input-throws.js @@ -7,6 +7,8 @@ description: > features: [Array.prototype.flatMap] ---*/ +assert.sameValue(typeof Array.prototype.flatMap, 'function'); + assert.throws(TypeError, function() { [].flatMap.call(null); }, 'null value'); diff --git a/js/src/tests/test262/built-ins/Array/prototype/flatMap/proxy-access-count.js b/js/src/tests/test262/built-ins/Array/prototype/flatMap/proxy-access-count.js index 336abb61df13..79e6b6ccc6d2 100644 --- a/js/src/tests/test262/built-ins/Array/prototype/flatMap/proxy-access-count.js +++ b/js/src/tests/test262/built-ins/Array/prototype/flatMap/proxy-access-count.js @@ -17,10 +17,12 @@ info: | b. Let exists be ? HasProperty(source, P). c. If exists is true, then i. Let element be ? Get(source, P). -features: [Array.prototype.flat] +features: [Array.prototype.flatMap] includes: [compareArray.js] ---*/ +assert.sameValue(typeof Array.prototype.flatMap, 'function'); + const getCalls = [], hasCalls = []; const handler = { get : function (t, p, r) { getCalls.push(p); return Reflect.get(t, p, r); }, diff --git a/js/src/tests/test262/built-ins/Array/prototype/sort/stability-11-elements.js b/js/src/tests/test262/built-ins/Array/prototype/sort/stability-11-elements.js new file mode 100644 index 000000000000..2505b5228a85 --- /dev/null +++ b/js/src/tests/test262/built-ins/Array/prototype/sort/stability-11-elements.js @@ -0,0 +1,38 @@ +// Copyright (C) 2018 Mathias Bynens. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.sort +description: > + Stability of Array.prototype.sort for an array with 11 elements. +info: | + The sort is required to be stable (that is, elements that compare equal + remain in their original order). + The array length of 11 was chosen because V8 used an unstable + QuickSort for arrays with more than 10 elements until v7.0 (September + 2018). https://v8.dev/blog/array-sort +---*/ + +const array = [ + { name: 'A', rating: 2 }, + { name: 'B', rating: 3 }, + { name: 'C', rating: 2 }, + { name: 'D', rating: 4 }, + { name: 'E', rating: 3 }, + { name: 'F', rating: 3 }, + { name: 'G', rating: 4 }, + { name: 'H', rating: 3 }, + { name: 'I', rating: 2 }, + { name: 'J', rating: 2 }, + { name: 'K', rating: 2 }, +]; +assert.sameValue(array.length, 11); + +// Sort the elements by `rating` in descending order. +// (This updates `array` in place.) +array.sort((a, b) => b.rating - a.rating); + +const reduced = array.reduce((acc, element) => acc + element.name, ''); +assert.sameValue(reduced, 'DGBEFHACIJK'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/sort/stability-2048-elements.js b/js/src/tests/test262/built-ins/Array/prototype/sort/stability-2048-elements.js new file mode 100644 index 000000000000..e791036a26a1 --- /dev/null +++ b/js/src/tests/test262/built-ins/Array/prototype/sort/stability-2048-elements.js @@ -0,0 +1,2083 @@ +// Copyright (C) 2018 Mathias Bynens. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.sort +description: > + Stability of Array.prototype.sort for an array with 2048 elements. +info: | + The sort is required to be stable (that is, elements that compare equal + remain in their original order). + The array length of 2048 was chosen because as of late 2018, Chakra + uses merge sort for arrays with 2048 or more elements. It uses + insertion sort for smaller arrays. + https://github.com/Microsoft/ChakraCore/pull/5724/files#diff-85203ec16f5961eb4c18e4253bb42140R337 +---*/ + +const array = [ + { name: 'A000', rating: 2 }, + { name: 'A001', rating: 2 }, + { name: 'A002', rating: 2 }, + { name: 'A003', rating: 2 }, + { name: 'A004', rating: 2 }, + { name: 'A005', rating: 2 }, + { name: 'A006', rating: 2 }, + { name: 'A007', rating: 2 }, + { name: 'A008', rating: 2 }, + { name: 'A009', rating: 2 }, + { name: 'A010', rating: 2 }, + { name: 'A011', rating: 2 }, + { name: 'A012', rating: 2 }, + { name: 'A013', rating: 2 }, + { name: 'A014', rating: 2 }, + { name: 'A015', rating: 2 }, + { name: 'A016', rating: 2 }, + { name: 'A017', rating: 2 }, + { name: 'A018', rating: 2 }, + { name: 'A019', rating: 2 }, + { name: 'A020', rating: 2 }, + { name: 'A021', rating: 2 }, + { name: 'A022', rating: 2 }, + { name: 'A023', rating: 2 }, + { name: 'A024', rating: 2 }, + { name: 'A025', rating: 2 }, + { name: 'A026', rating: 2 }, + { name: 'A027', rating: 2 }, + { name: 'A028', rating: 2 }, + { name: 'A029', rating: 2 }, + { name: 'A030', rating: 2 }, + { name: 'A031', rating: 2 }, + { name: 'A032', rating: 2 }, + { name: 'A033', rating: 2 }, + { name: 'A034', rating: 2 }, + { name: 'A035', rating: 2 }, + { name: 'A036', rating: 2 }, + { name: 'A037', rating: 2 }, + { name: 'A038', rating: 2 }, + { name: 'A039', rating: 2 }, + { name: 'A040', rating: 2 }, + { name: 'A041', rating: 2 }, + { name: 'A042', rating: 2 }, + { name: 'A043', rating: 2 }, + { name: 'A044', rating: 2 }, + { name: 'A045', rating: 2 }, + { name: 'A046', rating: 2 }, + { name: 'A047', rating: 2 }, + { name: 'A048', rating: 2 }, + { name: 'A049', rating: 2 }, + { name: 'A050', rating: 2 }, + { name: 'A051', rating: 2 }, + { name: 'A052', rating: 2 }, + { name: 'A053', rating: 2 }, + { name: 'A054', rating: 2 }, + { name: 'A055', rating: 2 }, + { name: 'A056', rating: 2 }, + { name: 'A057', rating: 2 }, + { name: 'A058', rating: 2 }, + { name: 'A059', rating: 2 }, + { name: 'A060', rating: 2 }, + { name: 'A061', rating: 2 }, + { name: 'A062', rating: 2 }, + { name: 'A063', rating: 2 }, + { name: 'A064', rating: 2 }, + { name: 'A065', rating: 2 }, + { name: 'A066', rating: 2 }, + { name: 'A067', rating: 2 }, + { name: 'A068', rating: 2 }, + { name: 'A069', rating: 2 }, + { name: 'A070', rating: 2 }, + { name: 'A071', rating: 2 }, + { name: 'A072', rating: 2 }, + { name: 'A073', rating: 2 }, + { name: 'A074', rating: 2 }, + { name: 'A075', rating: 2 }, + { name: 'A076', rating: 2 }, + { name: 'A077', rating: 2 }, + { name: 'A078', rating: 2 }, + { name: 'A079', rating: 2 }, + { name: 'A080', rating: 2 }, + { name: 'A081', rating: 2 }, + { name: 'A082', rating: 2 }, + { name: 'A083', rating: 2 }, + { name: 'A084', rating: 2 }, + { name: 'A085', rating: 2 }, + { name: 'A086', rating: 2 }, + { name: 'A087', rating: 2 }, + { name: 'A088', rating: 2 }, + { name: 'A089', rating: 2 }, + { name: 'A090', rating: 2 }, + { name: 'A091', rating: 2 }, + { name: 'A092', rating: 2 }, + { name: 'A093', rating: 2 }, + { name: 'A094', rating: 2 }, + { name: 'A095', rating: 2 }, + { name: 'A096', rating: 2 }, + { name: 'A097', rating: 2 }, + { name: 'A098', rating: 2 }, + { name: 'A099', rating: 2 }, + { name: 'A100', rating: 2 }, + { name: 'A101', rating: 2 }, + { name: 'A102', rating: 2 }, + { name: 'A103', rating: 2 }, + { name: 'A104', rating: 2 }, + { name: 'A105', rating: 2 }, + { name: 'A106', rating: 2 }, + { name: 'A107', rating: 2 }, + { name: 'A108', rating: 2 }, + { name: 'A109', rating: 2 }, + { name: 'A110', rating: 2 }, + { name: 'A111', rating: 2 }, + { name: 'A112', rating: 2 }, + { name: 'A113', rating: 2 }, + { name: 'A114', rating: 2 }, + { name: 'A115', rating: 2 }, + { name: 'A116', rating: 2 }, + { name: 'A117', rating: 2 }, + { name: 'A118', rating: 2 }, + { name: 'A119', rating: 2 }, + { name: 'A120', rating: 2 }, + { name: 'A121', rating: 2 }, + { name: 'A122', rating: 2 }, + { name: 'A123', rating: 2 }, + { name: 'A124', rating: 2 }, + { name: 'A125', rating: 2 }, + { name: 'A126', rating: 2 }, + { name: 'A127', rating: 2 }, + { name: 'A128', rating: 2 }, + { name: 'A129', rating: 2 }, + { name: 'A130', rating: 2 }, + { name: 'A131', rating: 2 }, + { name: 'A132', rating: 2 }, + { name: 'A133', rating: 2 }, + { name: 'A134', rating: 2 }, + { name: 'A135', rating: 2 }, + { name: 'A136', rating: 2 }, + { name: 'A137', rating: 2 }, + { name: 'A138', rating: 2 }, + { name: 'A139', rating: 2 }, + { name: 'A140', rating: 2 }, + { name: 'A141', rating: 2 }, + { name: 'A142', rating: 2 }, + { name: 'A143', rating: 2 }, + { name: 'A144', rating: 2 }, + { name: 'A145', rating: 2 }, + { name: 'A146', rating: 2 }, + { name: 'A147', rating: 2 }, + { name: 'A148', rating: 2 }, + { name: 'A149', rating: 2 }, + { name: 'A150', rating: 2 }, + { name: 'A151', rating: 2 }, + { name: 'A152', rating: 2 }, + { name: 'A153', rating: 2 }, + { name: 'A154', rating: 2 }, + { name: 'A155', rating: 2 }, + { name: 'A156', rating: 2 }, + { name: 'A157', rating: 2 }, + { name: 'A158', rating: 2 }, + { name: 'A159', rating: 2 }, + { name: 'A160', rating: 2 }, + { name: 'A161', rating: 2 }, + { name: 'A162', rating: 2 }, + { name: 'A163', rating: 2 }, + { name: 'A164', rating: 2 }, + { name: 'A165', rating: 2 }, + { name: 'A166', rating: 2 }, + { name: 'A167', rating: 2 }, + { name: 'A168', rating: 2 }, + { name: 'A169', rating: 2 }, + { name: 'A170', rating: 2 }, + { name: 'A171', rating: 2 }, + { name: 'A172', rating: 2 }, + { name: 'A173', rating: 2 }, + { name: 'A174', rating: 2 }, + { name: 'A175', rating: 2 }, + { name: 'A176', rating: 2 }, + { name: 'A177', rating: 2 }, + { name: 'A178', rating: 2 }, + { name: 'A179', rating: 2 }, + { name: 'A180', rating: 2 }, + { name: 'A181', rating: 2 }, + { name: 'A182', rating: 2 }, + { name: 'A183', rating: 2 }, + { name: 'A184', rating: 2 }, + { name: 'A185', rating: 2 }, + { name: 'A186', rating: 2 }, + { name: 'B000', rating: 3 }, + { name: 'B001', rating: 3 }, + { name: 'B002', rating: 3 }, + { name: 'B003', rating: 3 }, + { name: 'B004', rating: 3 }, + { name: 'B005', rating: 3 }, + { name: 'B006', rating: 3 }, + { name: 'B007', rating: 3 }, + { name: 'B008', rating: 3 }, + { name: 'B009', rating: 3 }, + { name: 'B010', rating: 3 }, + { name: 'B011', rating: 3 }, + { name: 'B012', rating: 3 }, + { name: 'B013', rating: 3 }, + { name: 'B014', rating: 3 }, + { name: 'B015', rating: 3 }, + { name: 'B016', rating: 3 }, + { name: 'B017', rating: 3 }, + { name: 'B018', rating: 3 }, + { name: 'B019', rating: 3 }, + { name: 'B020', rating: 3 }, + { name: 'B021', rating: 3 }, + { name: 'B022', rating: 3 }, + { name: 'B023', rating: 3 }, + { name: 'B024', rating: 3 }, + { name: 'B025', rating: 3 }, + { name: 'B026', rating: 3 }, + { name: 'B027', rating: 3 }, + { name: 'B028', rating: 3 }, + { name: 'B029', rating: 3 }, + { name: 'B030', rating: 3 }, + { name: 'B031', rating: 3 }, + { name: 'B032', rating: 3 }, + { name: 'B033', rating: 3 }, + { name: 'B034', rating: 3 }, + { name: 'B035', rating: 3 }, + { name: 'B036', rating: 3 }, + { name: 'B037', rating: 3 }, + { name: 'B038', rating: 3 }, + { name: 'B039', rating: 3 }, + { name: 'B040', rating: 3 }, + { name: 'B041', rating: 3 }, + { name: 'B042', rating: 3 }, + { name: 'B043', rating: 3 }, + { name: 'B044', rating: 3 }, + { name: 'B045', rating: 3 }, + { name: 'B046', rating: 3 }, + { name: 'B047', rating: 3 }, + { name: 'B048', rating: 3 }, + { name: 'B049', rating: 3 }, + { name: 'B050', rating: 3 }, + { name: 'B051', rating: 3 }, + { name: 'B052', rating: 3 }, + { name: 'B053', rating: 3 }, + { name: 'B054', rating: 3 }, + { name: 'B055', rating: 3 }, + { name: 'B056', rating: 3 }, + { name: 'B057', rating: 3 }, + { name: 'B058', rating: 3 }, + { name: 'B059', rating: 3 }, + { name: 'B060', rating: 3 }, + { name: 'B061', rating: 3 }, + { name: 'B062', rating: 3 }, + { name: 'B063', rating: 3 }, + { name: 'B064', rating: 3 }, + { name: 'B065', rating: 3 }, + { name: 'B066', rating: 3 }, + { name: 'B067', rating: 3 }, + { name: 'B068', rating: 3 }, + { name: 'B069', rating: 3 }, + { name: 'B070', rating: 3 }, + { name: 'B071', rating: 3 }, + { name: 'B072', rating: 3 }, + { name: 'B073', rating: 3 }, + { name: 'B074', rating: 3 }, + { name: 'B075', rating: 3 }, + { name: 'B076', rating: 3 }, + { name: 'B077', rating: 3 }, + { name: 'B078', rating: 3 }, + { name: 'B079', rating: 3 }, + { name: 'B080', rating: 3 }, + { name: 'B081', rating: 3 }, + { name: 'B082', rating: 3 }, + { name: 'B083', rating: 3 }, + { name: 'B084', rating: 3 }, + { name: 'B085', rating: 3 }, + { name: 'B086', rating: 3 }, + { name: 'B087', rating: 3 }, + { name: 'B088', rating: 3 }, + { name: 'B089', rating: 3 }, + { name: 'B090', rating: 3 }, + { name: 'B091', rating: 3 }, + { name: 'B092', rating: 3 }, + { name: 'B093', rating: 3 }, + { name: 'B094', rating: 3 }, + { name: 'B095', rating: 3 }, + { name: 'B096', rating: 3 }, + { name: 'B097', rating: 3 }, + { name: 'B098', rating: 3 }, + { name: 'B099', rating: 3 }, + { name: 'B100', rating: 3 }, + { name: 'B101', rating: 3 }, + { name: 'B102', rating: 3 }, + { name: 'B103', rating: 3 }, + { name: 'B104', rating: 3 }, + { name: 'B105', rating: 3 }, + { name: 'B106', rating: 3 }, + { name: 'B107', rating: 3 }, + { name: 'B108', rating: 3 }, + { name: 'B109', rating: 3 }, + { name: 'B110', rating: 3 }, + { name: 'B111', rating: 3 }, + { name: 'B112', rating: 3 }, + { name: 'B113', rating: 3 }, + { name: 'B114', rating: 3 }, + { name: 'B115', rating: 3 }, + { name: 'B116', rating: 3 }, + { name: 'B117', rating: 3 }, + { name: 'B118', rating: 3 }, + { name: 'B119', rating: 3 }, + { name: 'B120', rating: 3 }, + { name: 'B121', rating: 3 }, + { name: 'B122', rating: 3 }, + { name: 'B123', rating: 3 }, + { name: 'B124', rating: 3 }, + { name: 'B125', rating: 3 }, + { name: 'B126', rating: 3 }, + { name: 'B127', rating: 3 }, + { name: 'B128', rating: 3 }, + { name: 'B129', rating: 3 }, + { name: 'B130', rating: 3 }, + { name: 'B131', rating: 3 }, + { name: 'B132', rating: 3 }, + { name: 'B133', rating: 3 }, + { name: 'B134', rating: 3 }, + { name: 'B135', rating: 3 }, + { name: 'B136', rating: 3 }, + { name: 'B137', rating: 3 }, + { name: 'B138', rating: 3 }, + { name: 'B139', rating: 3 }, + { name: 'B140', rating: 3 }, + { name: 'B141', rating: 3 }, + { name: 'B142', rating: 3 }, + { name: 'B143', rating: 3 }, + { name: 'B144', rating: 3 }, + { name: 'B145', rating: 3 }, + { name: 'B146', rating: 3 }, + { name: 'B147', rating: 3 }, + { name: 'B148', rating: 3 }, + { name: 'B149', rating: 3 }, + { name: 'B150', rating: 3 }, + { name: 'B151', rating: 3 }, + { name: 'B152', rating: 3 }, + { name: 'B153', rating: 3 }, + { name: 'B154', rating: 3 }, + { name: 'B155', rating: 3 }, + { name: 'B156', rating: 3 }, + { name: 'B157', rating: 3 }, + { name: 'B158', rating: 3 }, + { name: 'B159', rating: 3 }, + { name: 'B160', rating: 3 }, + { name: 'B161', rating: 3 }, + { name: 'B162', rating: 3 }, + { name: 'B163', rating: 3 }, + { name: 'B164', rating: 3 }, + { name: 'B165', rating: 3 }, + { name: 'B166', rating: 3 }, + { name: 'B167', rating: 3 }, + { name: 'B168', rating: 3 }, + { name: 'B169', rating: 3 }, + { name: 'B170', rating: 3 }, + { name: 'B171', rating: 3 }, + { name: 'B172', rating: 3 }, + { name: 'B173', rating: 3 }, + { name: 'B174', rating: 3 }, + { name: 'B175', rating: 3 }, + { name: 'B176', rating: 3 }, + { name: 'B177', rating: 3 }, + { name: 'B178', rating: 3 }, + { name: 'B179', rating: 3 }, + { name: 'B180', rating: 3 }, + { name: 'B181', rating: 3 }, + { name: 'B182', rating: 3 }, + { name: 'B183', rating: 3 }, + { name: 'B184', rating: 3 }, + { name: 'B185', rating: 3 }, + { name: 'B186', rating: 3 }, + { name: 'C000', rating: 2 }, + { name: 'C001', rating: 2 }, + { name: 'C002', rating: 2 }, + { name: 'C003', rating: 2 }, + { name: 'C004', rating: 2 }, + { name: 'C005', rating: 2 }, + { name: 'C006', rating: 2 }, + { name: 'C007', rating: 2 }, + { name: 'C008', rating: 2 }, + { name: 'C009', rating: 2 }, + { name: 'C010', rating: 2 }, + { name: 'C011', rating: 2 }, + { name: 'C012', rating: 2 }, + { name: 'C013', rating: 2 }, + { name: 'C014', rating: 2 }, + { name: 'C015', rating: 2 }, + { name: 'C016', rating: 2 }, + { name: 'C017', rating: 2 }, + { name: 'C018', rating: 2 }, + { name: 'C019', rating: 2 }, + { name: 'C020', rating: 2 }, + { name: 'C021', rating: 2 }, + { name: 'C022', rating: 2 }, + { name: 'C023', rating: 2 }, + { name: 'C024', rating: 2 }, + { name: 'C025', rating: 2 }, + { name: 'C026', rating: 2 }, + { name: 'C027', rating: 2 }, + { name: 'C028', rating: 2 }, + { name: 'C029', rating: 2 }, + { name: 'C030', rating: 2 }, + { name: 'C031', rating: 2 }, + { name: 'C032', rating: 2 }, + { name: 'C033', rating: 2 }, + { name: 'C034', rating: 2 }, + { name: 'C035', rating: 2 }, + { name: 'C036', rating: 2 }, + { name: 'C037', rating: 2 }, + { name: 'C038', rating: 2 }, + { name: 'C039', rating: 2 }, + { name: 'C040', rating: 2 }, + { name: 'C041', rating: 2 }, + { name: 'C042', rating: 2 }, + { name: 'C043', rating: 2 }, + { name: 'C044', rating: 2 }, + { name: 'C045', rating: 2 }, + { name: 'C046', rating: 2 }, + { name: 'C047', rating: 2 }, + { name: 'C048', rating: 2 }, + { name: 'C049', rating: 2 }, + { name: 'C050', rating: 2 }, + { name: 'C051', rating: 2 }, + { name: 'C052', rating: 2 }, + { name: 'C053', rating: 2 }, + { name: 'C054', rating: 2 }, + { name: 'C055', rating: 2 }, + { name: 'C056', rating: 2 }, + { name: 'C057', rating: 2 }, + { name: 'C058', rating: 2 }, + { name: 'C059', rating: 2 }, + { name: 'C060', rating: 2 }, + { name: 'C061', rating: 2 }, + { name: 'C062', rating: 2 }, + { name: 'C063', rating: 2 }, + { name: 'C064', rating: 2 }, + { name: 'C065', rating: 2 }, + { name: 'C066', rating: 2 }, + { name: 'C067', rating: 2 }, + { name: 'C068', rating: 2 }, + { name: 'C069', rating: 2 }, + { name: 'C070', rating: 2 }, + { name: 'C071', rating: 2 }, + { name: 'C072', rating: 2 }, + { name: 'C073', rating: 2 }, + { name: 'C074', rating: 2 }, + { name: 'C075', rating: 2 }, + { name: 'C076', rating: 2 }, + { name: 'C077', rating: 2 }, + { name: 'C078', rating: 2 }, + { name: 'C079', rating: 2 }, + { name: 'C080', rating: 2 }, + { name: 'C081', rating: 2 }, + { name: 'C082', rating: 2 }, + { name: 'C083', rating: 2 }, + { name: 'C084', rating: 2 }, + { name: 'C085', rating: 2 }, + { name: 'C086', rating: 2 }, + { name: 'C087', rating: 2 }, + { name: 'C088', rating: 2 }, + { name: 'C089', rating: 2 }, + { name: 'C090', rating: 2 }, + { name: 'C091', rating: 2 }, + { name: 'C092', rating: 2 }, + { name: 'C093', rating: 2 }, + { name: 'C094', rating: 2 }, + { name: 'C095', rating: 2 }, + { name: 'C096', rating: 2 }, + { name: 'C097', rating: 2 }, + { name: 'C098', rating: 2 }, + { name: 'C099', rating: 2 }, + { name: 'C100', rating: 2 }, + { name: 'C101', rating: 2 }, + { name: 'C102', rating: 2 }, + { name: 'C103', rating: 2 }, + { name: 'C104', rating: 2 }, + { name: 'C105', rating: 2 }, + { name: 'C106', rating: 2 }, + { name: 'C107', rating: 2 }, + { name: 'C108', rating: 2 }, + { name: 'C109', rating: 2 }, + { name: 'C110', rating: 2 }, + { name: 'C111', rating: 2 }, + { name: 'C112', rating: 2 }, + { name: 'C113', rating: 2 }, + { name: 'C114', rating: 2 }, + { name: 'C115', rating: 2 }, + { name: 'C116', rating: 2 }, + { name: 'C117', rating: 2 }, + { name: 'C118', rating: 2 }, + { name: 'C119', rating: 2 }, + { name: 'C120', rating: 2 }, + { name: 'C121', rating: 2 }, + { name: 'C122', rating: 2 }, + { name: 'C123', rating: 2 }, + { name: 'C124', rating: 2 }, + { name: 'C125', rating: 2 }, + { name: 'C126', rating: 2 }, + { name: 'C127', rating: 2 }, + { name: 'C128', rating: 2 }, + { name: 'C129', rating: 2 }, + { name: 'C130', rating: 2 }, + { name: 'C131', rating: 2 }, + { name: 'C132', rating: 2 }, + { name: 'C133', rating: 2 }, + { name: 'C134', rating: 2 }, + { name: 'C135', rating: 2 }, + { name: 'C136', rating: 2 }, + { name: 'C137', rating: 2 }, + { name: 'C138', rating: 2 }, + { name: 'C139', rating: 2 }, + { name: 'C140', rating: 2 }, + { name: 'C141', rating: 2 }, + { name: 'C142', rating: 2 }, + { name: 'C143', rating: 2 }, + { name: 'C144', rating: 2 }, + { name: 'C145', rating: 2 }, + { name: 'C146', rating: 2 }, + { name: 'C147', rating: 2 }, + { name: 'C148', rating: 2 }, + { name: 'C149', rating: 2 }, + { name: 'C150', rating: 2 }, + { name: 'C151', rating: 2 }, + { name: 'C152', rating: 2 }, + { name: 'C153', rating: 2 }, + { name: 'C154', rating: 2 }, + { name: 'C155', rating: 2 }, + { name: 'C156', rating: 2 }, + { name: 'C157', rating: 2 }, + { name: 'C158', rating: 2 }, + { name: 'C159', rating: 2 }, + { name: 'C160', rating: 2 }, + { name: 'C161', rating: 2 }, + { name: 'C162', rating: 2 }, + { name: 'C163', rating: 2 }, + { name: 'C164', rating: 2 }, + { name: 'C165', rating: 2 }, + { name: 'C166', rating: 2 }, + { name: 'C167', rating: 2 }, + { name: 'C168', rating: 2 }, + { name: 'C169', rating: 2 }, + { name: 'C170', rating: 2 }, + { name: 'C171', rating: 2 }, + { name: 'C172', rating: 2 }, + { name: 'C173', rating: 2 }, + { name: 'C174', rating: 2 }, + { name: 'C175', rating: 2 }, + { name: 'C176', rating: 2 }, + { name: 'C177', rating: 2 }, + { name: 'C178', rating: 2 }, + { name: 'C179', rating: 2 }, + { name: 'C180', rating: 2 }, + { name: 'C181', rating: 2 }, + { name: 'C182', rating: 2 }, + { name: 'C183', rating: 2 }, + { name: 'C184', rating: 2 }, + { name: 'C185', rating: 2 }, + { name: 'C186', rating: 2 }, + { name: 'D000', rating: 4 }, + { name: 'D001', rating: 4 }, + { name: 'D002', rating: 4 }, + { name: 'D003', rating: 4 }, + { name: 'D004', rating: 4 }, + { name: 'D005', rating: 4 }, + { name: 'D006', rating: 4 }, + { name: 'D007', rating: 4 }, + { name: 'D008', rating: 4 }, + { name: 'D009', rating: 4 }, + { name: 'D010', rating: 4 }, + { name: 'D011', rating: 4 }, + { name: 'D012', rating: 4 }, + { name: 'D013', rating: 4 }, + { name: 'D014', rating: 4 }, + { name: 'D015', rating: 4 }, + { name: 'D016', rating: 4 }, + { name: 'D017', rating: 4 }, + { name: 'D018', rating: 4 }, + { name: 'D019', rating: 4 }, + { name: 'D020', rating: 4 }, + { name: 'D021', rating: 4 }, + { name: 'D022', rating: 4 }, + { name: 'D023', rating: 4 }, + { name: 'D024', rating: 4 }, + { name: 'D025', rating: 4 }, + { name: 'D026', rating: 4 }, + { name: 'D027', rating: 4 }, + { name: 'D028', rating: 4 }, + { name: 'D029', rating: 4 }, + { name: 'D030', rating: 4 }, + { name: 'D031', rating: 4 }, + { name: 'D032', rating: 4 }, + { name: 'D033', rating: 4 }, + { name: 'D034', rating: 4 }, + { name: 'D035', rating: 4 }, + { name: 'D036', rating: 4 }, + { name: 'D037', rating: 4 }, + { name: 'D038', rating: 4 }, + { name: 'D039', rating: 4 }, + { name: 'D040', rating: 4 }, + { name: 'D041', rating: 4 }, + { name: 'D042', rating: 4 }, + { name: 'D043', rating: 4 }, + { name: 'D044', rating: 4 }, + { name: 'D045', rating: 4 }, + { name: 'D046', rating: 4 }, + { name: 'D047', rating: 4 }, + { name: 'D048', rating: 4 }, + { name: 'D049', rating: 4 }, + { name: 'D050', rating: 4 }, + { name: 'D051', rating: 4 }, + { name: 'D052', rating: 4 }, + { name: 'D053', rating: 4 }, + { name: 'D054', rating: 4 }, + { name: 'D055', rating: 4 }, + { name: 'D056', rating: 4 }, + { name: 'D057', rating: 4 }, + { name: 'D058', rating: 4 }, + { name: 'D059', rating: 4 }, + { name: 'D060', rating: 4 }, + { name: 'D061', rating: 4 }, + { name: 'D062', rating: 4 }, + { name: 'D063', rating: 4 }, + { name: 'D064', rating: 4 }, + { name: 'D065', rating: 4 }, + { name: 'D066', rating: 4 }, + { name: 'D067', rating: 4 }, + { name: 'D068', rating: 4 }, + { name: 'D069', rating: 4 }, + { name: 'D070', rating: 4 }, + { name: 'D071', rating: 4 }, + { name: 'D072', rating: 4 }, + { name: 'D073', rating: 4 }, + { name: 'D074', rating: 4 }, + { name: 'D075', rating: 4 }, + { name: 'D076', rating: 4 }, + { name: 'D077', rating: 4 }, + { name: 'D078', rating: 4 }, + { name: 'D079', rating: 4 }, + { name: 'D080', rating: 4 }, + { name: 'D081', rating: 4 }, + { name: 'D082', rating: 4 }, + { name: 'D083', rating: 4 }, + { name: 'D084', rating: 4 }, + { name: 'D085', rating: 4 }, + { name: 'D086', rating: 4 }, + { name: 'D087', rating: 4 }, + { name: 'D088', rating: 4 }, + { name: 'D089', rating: 4 }, + { name: 'D090', rating: 4 }, + { name: 'D091', rating: 4 }, + { name: 'D092', rating: 4 }, + { name: 'D093', rating: 4 }, + { name: 'D094', rating: 4 }, + { name: 'D095', rating: 4 }, + { name: 'D096', rating: 4 }, + { name: 'D097', rating: 4 }, + { name: 'D098', rating: 4 }, + { name: 'D099', rating: 4 }, + { name: 'D100', rating: 4 }, + { name: 'D101', rating: 4 }, + { name: 'D102', rating: 4 }, + { name: 'D103', rating: 4 }, + { name: 'D104', rating: 4 }, + { name: 'D105', rating: 4 }, + { name: 'D106', rating: 4 }, + { name: 'D107', rating: 4 }, + { name: 'D108', rating: 4 }, + { name: 'D109', rating: 4 }, + { name: 'D110', rating: 4 }, + { name: 'D111', rating: 4 }, + { name: 'D112', rating: 4 }, + { name: 'D113', rating: 4 }, + { name: 'D114', rating: 4 }, + { name: 'D115', rating: 4 }, + { name: 'D116', rating: 4 }, + { name: 'D117', rating: 4 }, + { name: 'D118', rating: 4 }, + { name: 'D119', rating: 4 }, + { name: 'D120', rating: 4 }, + { name: 'D121', rating: 4 }, + { name: 'D122', rating: 4 }, + { name: 'D123', rating: 4 }, + { name: 'D124', rating: 4 }, + { name: 'D125', rating: 4 }, + { name: 'D126', rating: 4 }, + { name: 'D127', rating: 4 }, + { name: 'D128', rating: 4 }, + { name: 'D129', rating: 4 }, + { name: 'D130', rating: 4 }, + { name: 'D131', rating: 4 }, + { name: 'D132', rating: 4 }, + { name: 'D133', rating: 4 }, + { name: 'D134', rating: 4 }, + { name: 'D135', rating: 4 }, + { name: 'D136', rating: 4 }, + { name: 'D137', rating: 4 }, + { name: 'D138', rating: 4 }, + { name: 'D139', rating: 4 }, + { name: 'D140', rating: 4 }, + { name: 'D141', rating: 4 }, + { name: 'D142', rating: 4 }, + { name: 'D143', rating: 4 }, + { name: 'D144', rating: 4 }, + { name: 'D145', rating: 4 }, + { name: 'D146', rating: 4 }, + { name: 'D147', rating: 4 }, + { name: 'D148', rating: 4 }, + { name: 'D149', rating: 4 }, + { name: 'D150', rating: 4 }, + { name: 'D151', rating: 4 }, + { name: 'D152', rating: 4 }, + { name: 'D153', rating: 4 }, + { name: 'D154', rating: 4 }, + { name: 'D155', rating: 4 }, + { name: 'D156', rating: 4 }, + { name: 'D157', rating: 4 }, + { name: 'D158', rating: 4 }, + { name: 'D159', rating: 4 }, + { name: 'D160', rating: 4 }, + { name: 'D161', rating: 4 }, + { name: 'D162', rating: 4 }, + { name: 'D163', rating: 4 }, + { name: 'D164', rating: 4 }, + { name: 'D165', rating: 4 }, + { name: 'D166', rating: 4 }, + { name: 'D167', rating: 4 }, + { name: 'D168', rating: 4 }, + { name: 'D169', rating: 4 }, + { name: 'D170', rating: 4 }, + { name: 'D171', rating: 4 }, + { name: 'D172', rating: 4 }, + { name: 'D173', rating: 4 }, + { name: 'D174', rating: 4 }, + { name: 'D175', rating: 4 }, + { name: 'D176', rating: 4 }, + { name: 'D177', rating: 4 }, + { name: 'D178', rating: 4 }, + { name: 'D179', rating: 4 }, + { name: 'D180', rating: 4 }, + { name: 'D181', rating: 4 }, + { name: 'D182', rating: 4 }, + { name: 'D183', rating: 4 }, + { name: 'D184', rating: 4 }, + { name: 'D185', rating: 4 }, + { name: 'D186', rating: 4 }, + { name: 'E000', rating: 3 }, + { name: 'E001', rating: 3 }, + { name: 'E002', rating: 3 }, + { name: 'E003', rating: 3 }, + { name: 'E004', rating: 3 }, + { name: 'E005', rating: 3 }, + { name: 'E006', rating: 3 }, + { name: 'E007', rating: 3 }, + { name: 'E008', rating: 3 }, + { name: 'E009', rating: 3 }, + { name: 'E010', rating: 3 }, + { name: 'E011', rating: 3 }, + { name: 'E012', rating: 3 }, + { name: 'E013', rating: 3 }, + { name: 'E014', rating: 3 }, + { name: 'E015', rating: 3 }, + { name: 'E016', rating: 3 }, + { name: 'E017', rating: 3 }, + { name: 'E018', rating: 3 }, + { name: 'E019', rating: 3 }, + { name: 'E020', rating: 3 }, + { name: 'E021', rating: 3 }, + { name: 'E022', rating: 3 }, + { name: 'E023', rating: 3 }, + { name: 'E024', rating: 3 }, + { name: 'E025', rating: 3 }, + { name: 'E026', rating: 3 }, + { name: 'E027', rating: 3 }, + { name: 'E028', rating: 3 }, + { name: 'E029', rating: 3 }, + { name: 'E030', rating: 3 }, + { name: 'E031', rating: 3 }, + { name: 'E032', rating: 3 }, + { name: 'E033', rating: 3 }, + { name: 'E034', rating: 3 }, + { name: 'E035', rating: 3 }, + { name: 'E036', rating: 3 }, + { name: 'E037', rating: 3 }, + { name: 'E038', rating: 3 }, + { name: 'E039', rating: 3 }, + { name: 'E040', rating: 3 }, + { name: 'E041', rating: 3 }, + { name: 'E042', rating: 3 }, + { name: 'E043', rating: 3 }, + { name: 'E044', rating: 3 }, + { name: 'E045', rating: 3 }, + { name: 'E046', rating: 3 }, + { name: 'E047', rating: 3 }, + { name: 'E048', rating: 3 }, + { name: 'E049', rating: 3 }, + { name: 'E050', rating: 3 }, + { name: 'E051', rating: 3 }, + { name: 'E052', rating: 3 }, + { name: 'E053', rating: 3 }, + { name: 'E054', rating: 3 }, + { name: 'E055', rating: 3 }, + { name: 'E056', rating: 3 }, + { name: 'E057', rating: 3 }, + { name: 'E058', rating: 3 }, + { name: 'E059', rating: 3 }, + { name: 'E060', rating: 3 }, + { name: 'E061', rating: 3 }, + { name: 'E062', rating: 3 }, + { name: 'E063', rating: 3 }, + { name: 'E064', rating: 3 }, + { name: 'E065', rating: 3 }, + { name: 'E066', rating: 3 }, + { name: 'E067', rating: 3 }, + { name: 'E068', rating: 3 }, + { name: 'E069', rating: 3 }, + { name: 'E070', rating: 3 }, + { name: 'E071', rating: 3 }, + { name: 'E072', rating: 3 }, + { name: 'E073', rating: 3 }, + { name: 'E074', rating: 3 }, + { name: 'E075', rating: 3 }, + { name: 'E076', rating: 3 }, + { name: 'E077', rating: 3 }, + { name: 'E078', rating: 3 }, + { name: 'E079', rating: 3 }, + { name: 'E080', rating: 3 }, + { name: 'E081', rating: 3 }, + { name: 'E082', rating: 3 }, + { name: 'E083', rating: 3 }, + { name: 'E084', rating: 3 }, + { name: 'E085', rating: 3 }, + { name: 'E086', rating: 3 }, + { name: 'E087', rating: 3 }, + { name: 'E088', rating: 3 }, + { name: 'E089', rating: 3 }, + { name: 'E090', rating: 3 }, + { name: 'E091', rating: 3 }, + { name: 'E092', rating: 3 }, + { name: 'E093', rating: 3 }, + { name: 'E094', rating: 3 }, + { name: 'E095', rating: 3 }, + { name: 'E096', rating: 3 }, + { name: 'E097', rating: 3 }, + { name: 'E098', rating: 3 }, + { name: 'E099', rating: 3 }, + { name: 'E100', rating: 3 }, + { name: 'E101', rating: 3 }, + { name: 'E102', rating: 3 }, + { name: 'E103', rating: 3 }, + { name: 'E104', rating: 3 }, + { name: 'E105', rating: 3 }, + { name: 'E106', rating: 3 }, + { name: 'E107', rating: 3 }, + { name: 'E108', rating: 3 }, + { name: 'E109', rating: 3 }, + { name: 'E110', rating: 3 }, + { name: 'E111', rating: 3 }, + { name: 'E112', rating: 3 }, + { name: 'E113', rating: 3 }, + { name: 'E114', rating: 3 }, + { name: 'E115', rating: 3 }, + { name: 'E116', rating: 3 }, + { name: 'E117', rating: 3 }, + { name: 'E118', rating: 3 }, + { name: 'E119', rating: 3 }, + { name: 'E120', rating: 3 }, + { name: 'E121', rating: 3 }, + { name: 'E122', rating: 3 }, + { name: 'E123', rating: 3 }, + { name: 'E124', rating: 3 }, + { name: 'E125', rating: 3 }, + { name: 'E126', rating: 3 }, + { name: 'E127', rating: 3 }, + { name: 'E128', rating: 3 }, + { name: 'E129', rating: 3 }, + { name: 'E130', rating: 3 }, + { name: 'E131', rating: 3 }, + { name: 'E132', rating: 3 }, + { name: 'E133', rating: 3 }, + { name: 'E134', rating: 3 }, + { name: 'E135', rating: 3 }, + { name: 'E136', rating: 3 }, + { name: 'E137', rating: 3 }, + { name: 'E138', rating: 3 }, + { name: 'E139', rating: 3 }, + { name: 'E140', rating: 3 }, + { name: 'E141', rating: 3 }, + { name: 'E142', rating: 3 }, + { name: 'E143', rating: 3 }, + { name: 'E144', rating: 3 }, + { name: 'E145', rating: 3 }, + { name: 'E146', rating: 3 }, + { name: 'E147', rating: 3 }, + { name: 'E148', rating: 3 }, + { name: 'E149', rating: 3 }, + { name: 'E150', rating: 3 }, + { name: 'E151', rating: 3 }, + { name: 'E152', rating: 3 }, + { name: 'E153', rating: 3 }, + { name: 'E154', rating: 3 }, + { name: 'E155', rating: 3 }, + { name: 'E156', rating: 3 }, + { name: 'E157', rating: 3 }, + { name: 'E158', rating: 3 }, + { name: 'E159', rating: 3 }, + { name: 'E160', rating: 3 }, + { name: 'E161', rating: 3 }, + { name: 'E162', rating: 3 }, + { name: 'E163', rating: 3 }, + { name: 'E164', rating: 3 }, + { name: 'E165', rating: 3 }, + { name: 'E166', rating: 3 }, + { name: 'E167', rating: 3 }, + { name: 'E168', rating: 3 }, + { name: 'E169', rating: 3 }, + { name: 'E170', rating: 3 }, + { name: 'E171', rating: 3 }, + { name: 'E172', rating: 3 }, + { name: 'E173', rating: 3 }, + { name: 'E174', rating: 3 }, + { name: 'E175', rating: 3 }, + { name: 'E176', rating: 3 }, + { name: 'E177', rating: 3 }, + { name: 'E178', rating: 3 }, + { name: 'E179', rating: 3 }, + { name: 'E180', rating: 3 }, + { name: 'E181', rating: 3 }, + { name: 'E182', rating: 3 }, + { name: 'E183', rating: 3 }, + { name: 'E184', rating: 3 }, + { name: 'E185', rating: 3 }, + { name: 'E186', rating: 3 }, + { name: 'F000', rating: 3 }, + { name: 'F001', rating: 3 }, + { name: 'F002', rating: 3 }, + { name: 'F003', rating: 3 }, + { name: 'F004', rating: 3 }, + { name: 'F005', rating: 3 }, + { name: 'F006', rating: 3 }, + { name: 'F007', rating: 3 }, + { name: 'F008', rating: 3 }, + { name: 'F009', rating: 3 }, + { name: 'F010', rating: 3 }, + { name: 'F011', rating: 3 }, + { name: 'F012', rating: 3 }, + { name: 'F013', rating: 3 }, + { name: 'F014', rating: 3 }, + { name: 'F015', rating: 3 }, + { name: 'F016', rating: 3 }, + { name: 'F017', rating: 3 }, + { name: 'F018', rating: 3 }, + { name: 'F019', rating: 3 }, + { name: 'F020', rating: 3 }, + { name: 'F021', rating: 3 }, + { name: 'F022', rating: 3 }, + { name: 'F023', rating: 3 }, + { name: 'F024', rating: 3 }, + { name: 'F025', rating: 3 }, + { name: 'F026', rating: 3 }, + { name: 'F027', rating: 3 }, + { name: 'F028', rating: 3 }, + { name: 'F029', rating: 3 }, + { name: 'F030', rating: 3 }, + { name: 'F031', rating: 3 }, + { name: 'F032', rating: 3 }, + { name: 'F033', rating: 3 }, + { name: 'F034', rating: 3 }, + { name: 'F035', rating: 3 }, + { name: 'F036', rating: 3 }, + { name: 'F037', rating: 3 }, + { name: 'F038', rating: 3 }, + { name: 'F039', rating: 3 }, + { name: 'F040', rating: 3 }, + { name: 'F041', rating: 3 }, + { name: 'F042', rating: 3 }, + { name: 'F043', rating: 3 }, + { name: 'F044', rating: 3 }, + { name: 'F045', rating: 3 }, + { name: 'F046', rating: 3 }, + { name: 'F047', rating: 3 }, + { name: 'F048', rating: 3 }, + { name: 'F049', rating: 3 }, + { name: 'F050', rating: 3 }, + { name: 'F051', rating: 3 }, + { name: 'F052', rating: 3 }, + { name: 'F053', rating: 3 }, + { name: 'F054', rating: 3 }, + { name: 'F055', rating: 3 }, + { name: 'F056', rating: 3 }, + { name: 'F057', rating: 3 }, + { name: 'F058', rating: 3 }, + { name: 'F059', rating: 3 }, + { name: 'F060', rating: 3 }, + { name: 'F061', rating: 3 }, + { name: 'F062', rating: 3 }, + { name: 'F063', rating: 3 }, + { name: 'F064', rating: 3 }, + { name: 'F065', rating: 3 }, + { name: 'F066', rating: 3 }, + { name: 'F067', rating: 3 }, + { name: 'F068', rating: 3 }, + { name: 'F069', rating: 3 }, + { name: 'F070', rating: 3 }, + { name: 'F071', rating: 3 }, + { name: 'F072', rating: 3 }, + { name: 'F073', rating: 3 }, + { name: 'F074', rating: 3 }, + { name: 'F075', rating: 3 }, + { name: 'F076', rating: 3 }, + { name: 'F077', rating: 3 }, + { name: 'F078', rating: 3 }, + { name: 'F079', rating: 3 }, + { name: 'F080', rating: 3 }, + { name: 'F081', rating: 3 }, + { name: 'F082', rating: 3 }, + { name: 'F083', rating: 3 }, + { name: 'F084', rating: 3 }, + { name: 'F085', rating: 3 }, + { name: 'F086', rating: 3 }, + { name: 'F087', rating: 3 }, + { name: 'F088', rating: 3 }, + { name: 'F089', rating: 3 }, + { name: 'F090', rating: 3 }, + { name: 'F091', rating: 3 }, + { name: 'F092', rating: 3 }, + { name: 'F093', rating: 3 }, + { name: 'F094', rating: 3 }, + { name: 'F095', rating: 3 }, + { name: 'F096', rating: 3 }, + { name: 'F097', rating: 3 }, + { name: 'F098', rating: 3 }, + { name: 'F099', rating: 3 }, + { name: 'F100', rating: 3 }, + { name: 'F101', rating: 3 }, + { name: 'F102', rating: 3 }, + { name: 'F103', rating: 3 }, + { name: 'F104', rating: 3 }, + { name: 'F105', rating: 3 }, + { name: 'F106', rating: 3 }, + { name: 'F107', rating: 3 }, + { name: 'F108', rating: 3 }, + { name: 'F109', rating: 3 }, + { name: 'F110', rating: 3 }, + { name: 'F111', rating: 3 }, + { name: 'F112', rating: 3 }, + { name: 'F113', rating: 3 }, + { name: 'F114', rating: 3 }, + { name: 'F115', rating: 3 }, + { name: 'F116', rating: 3 }, + { name: 'F117', rating: 3 }, + { name: 'F118', rating: 3 }, + { name: 'F119', rating: 3 }, + { name: 'F120', rating: 3 }, + { name: 'F121', rating: 3 }, + { name: 'F122', rating: 3 }, + { name: 'F123', rating: 3 }, + { name: 'F124', rating: 3 }, + { name: 'F125', rating: 3 }, + { name: 'F126', rating: 3 }, + { name: 'F127', rating: 3 }, + { name: 'F128', rating: 3 }, + { name: 'F129', rating: 3 }, + { name: 'F130', rating: 3 }, + { name: 'F131', rating: 3 }, + { name: 'F132', rating: 3 }, + { name: 'F133', rating: 3 }, + { name: 'F134', rating: 3 }, + { name: 'F135', rating: 3 }, + { name: 'F136', rating: 3 }, + { name: 'F137', rating: 3 }, + { name: 'F138', rating: 3 }, + { name: 'F139', rating: 3 }, + { name: 'F140', rating: 3 }, + { name: 'F141', rating: 3 }, + { name: 'F142', rating: 3 }, + { name: 'F143', rating: 3 }, + { name: 'F144', rating: 3 }, + { name: 'F145', rating: 3 }, + { name: 'F146', rating: 3 }, + { name: 'F147', rating: 3 }, + { name: 'F148', rating: 3 }, + { name: 'F149', rating: 3 }, + { name: 'F150', rating: 3 }, + { name: 'F151', rating: 3 }, + { name: 'F152', rating: 3 }, + { name: 'F153', rating: 3 }, + { name: 'F154', rating: 3 }, + { name: 'F155', rating: 3 }, + { name: 'F156', rating: 3 }, + { name: 'F157', rating: 3 }, + { name: 'F158', rating: 3 }, + { name: 'F159', rating: 3 }, + { name: 'F160', rating: 3 }, + { name: 'F161', rating: 3 }, + { name: 'F162', rating: 3 }, + { name: 'F163', rating: 3 }, + { name: 'F164', rating: 3 }, + { name: 'F165', rating: 3 }, + { name: 'F166', rating: 3 }, + { name: 'F167', rating: 3 }, + { name: 'F168', rating: 3 }, + { name: 'F169', rating: 3 }, + { name: 'F170', rating: 3 }, + { name: 'F171', rating: 3 }, + { name: 'F172', rating: 3 }, + { name: 'F173', rating: 3 }, + { name: 'F174', rating: 3 }, + { name: 'F175', rating: 3 }, + { name: 'F176', rating: 3 }, + { name: 'F177', rating: 3 }, + { name: 'F178', rating: 3 }, + { name: 'F179', rating: 3 }, + { name: 'F180', rating: 3 }, + { name: 'F181', rating: 3 }, + { name: 'F182', rating: 3 }, + { name: 'F183', rating: 3 }, + { name: 'F184', rating: 3 }, + { name: 'F185', rating: 3 }, + { name: 'F186', rating: 3 }, + { name: 'G000', rating: 4 }, + { name: 'G001', rating: 4 }, + { name: 'G002', rating: 4 }, + { name: 'G003', rating: 4 }, + { name: 'G004', rating: 4 }, + { name: 'G005', rating: 4 }, + { name: 'G006', rating: 4 }, + { name: 'G007', rating: 4 }, + { name: 'G008', rating: 4 }, + { name: 'G009', rating: 4 }, + { name: 'G010', rating: 4 }, + { name: 'G011', rating: 4 }, + { name: 'G012', rating: 4 }, + { name: 'G013', rating: 4 }, + { name: 'G014', rating: 4 }, + { name: 'G015', rating: 4 }, + { name: 'G016', rating: 4 }, + { name: 'G017', rating: 4 }, + { name: 'G018', rating: 4 }, + { name: 'G019', rating: 4 }, + { name: 'G020', rating: 4 }, + { name: 'G021', rating: 4 }, + { name: 'G022', rating: 4 }, + { name: 'G023', rating: 4 }, + { name: 'G024', rating: 4 }, + { name: 'G025', rating: 4 }, + { name: 'G026', rating: 4 }, + { name: 'G027', rating: 4 }, + { name: 'G028', rating: 4 }, + { name: 'G029', rating: 4 }, + { name: 'G030', rating: 4 }, + { name: 'G031', rating: 4 }, + { name: 'G032', rating: 4 }, + { name: 'G033', rating: 4 }, + { name: 'G034', rating: 4 }, + { name: 'G035', rating: 4 }, + { name: 'G036', rating: 4 }, + { name: 'G037', rating: 4 }, + { name: 'G038', rating: 4 }, + { name: 'G039', rating: 4 }, + { name: 'G040', rating: 4 }, + { name: 'G041', rating: 4 }, + { name: 'G042', rating: 4 }, + { name: 'G043', rating: 4 }, + { name: 'G044', rating: 4 }, + { name: 'G045', rating: 4 }, + { name: 'G046', rating: 4 }, + { name: 'G047', rating: 4 }, + { name: 'G048', rating: 4 }, + { name: 'G049', rating: 4 }, + { name: 'G050', rating: 4 }, + { name: 'G051', rating: 4 }, + { name: 'G052', rating: 4 }, + { name: 'G053', rating: 4 }, + { name: 'G054', rating: 4 }, + { name: 'G055', rating: 4 }, + { name: 'G056', rating: 4 }, + { name: 'G057', rating: 4 }, + { name: 'G058', rating: 4 }, + { name: 'G059', rating: 4 }, + { name: 'G060', rating: 4 }, + { name: 'G061', rating: 4 }, + { name: 'G062', rating: 4 }, + { name: 'G063', rating: 4 }, + { name: 'G064', rating: 4 }, + { name: 'G065', rating: 4 }, + { name: 'G066', rating: 4 }, + { name: 'G067', rating: 4 }, + { name: 'G068', rating: 4 }, + { name: 'G069', rating: 4 }, + { name: 'G070', rating: 4 }, + { name: 'G071', rating: 4 }, + { name: 'G072', rating: 4 }, + { name: 'G073', rating: 4 }, + { name: 'G074', rating: 4 }, + { name: 'G075', rating: 4 }, + { name: 'G076', rating: 4 }, + { name: 'G077', rating: 4 }, + { name: 'G078', rating: 4 }, + { name: 'G079', rating: 4 }, + { name: 'G080', rating: 4 }, + { name: 'G081', rating: 4 }, + { name: 'G082', rating: 4 }, + { name: 'G083', rating: 4 }, + { name: 'G084', rating: 4 }, + { name: 'G085', rating: 4 }, + { name: 'G086', rating: 4 }, + { name: 'G087', rating: 4 }, + { name: 'G088', rating: 4 }, + { name: 'G089', rating: 4 }, + { name: 'G090', rating: 4 }, + { name: 'G091', rating: 4 }, + { name: 'G092', rating: 4 }, + { name: 'G093', rating: 4 }, + { name: 'G094', rating: 4 }, + { name: 'G095', rating: 4 }, + { name: 'G096', rating: 4 }, + { name: 'G097', rating: 4 }, + { name: 'G098', rating: 4 }, + { name: 'G099', rating: 4 }, + { name: 'G100', rating: 4 }, + { name: 'G101', rating: 4 }, + { name: 'G102', rating: 4 }, + { name: 'G103', rating: 4 }, + { name: 'G104', rating: 4 }, + { name: 'G105', rating: 4 }, + { name: 'G106', rating: 4 }, + { name: 'G107', rating: 4 }, + { name: 'G108', rating: 4 }, + { name: 'G109', rating: 4 }, + { name: 'G110', rating: 4 }, + { name: 'G111', rating: 4 }, + { name: 'G112', rating: 4 }, + { name: 'G113', rating: 4 }, + { name: 'G114', rating: 4 }, + { name: 'G115', rating: 4 }, + { name: 'G116', rating: 4 }, + { name: 'G117', rating: 4 }, + { name: 'G118', rating: 4 }, + { name: 'G119', rating: 4 }, + { name: 'G120', rating: 4 }, + { name: 'G121', rating: 4 }, + { name: 'G122', rating: 4 }, + { name: 'G123', rating: 4 }, + { name: 'G124', rating: 4 }, + { name: 'G125', rating: 4 }, + { name: 'G126', rating: 4 }, + { name: 'G127', rating: 4 }, + { name: 'G128', rating: 4 }, + { name: 'G129', rating: 4 }, + { name: 'G130', rating: 4 }, + { name: 'G131', rating: 4 }, + { name: 'G132', rating: 4 }, + { name: 'G133', rating: 4 }, + { name: 'G134', rating: 4 }, + { name: 'G135', rating: 4 }, + { name: 'G136', rating: 4 }, + { name: 'G137', rating: 4 }, + { name: 'G138', rating: 4 }, + { name: 'G139', rating: 4 }, + { name: 'G140', rating: 4 }, + { name: 'G141', rating: 4 }, + { name: 'G142', rating: 4 }, + { name: 'G143', rating: 4 }, + { name: 'G144', rating: 4 }, + { name: 'G145', rating: 4 }, + { name: 'G146', rating: 4 }, + { name: 'G147', rating: 4 }, + { name: 'G148', rating: 4 }, + { name: 'G149', rating: 4 }, + { name: 'G150', rating: 4 }, + { name: 'G151', rating: 4 }, + { name: 'G152', rating: 4 }, + { name: 'G153', rating: 4 }, + { name: 'G154', rating: 4 }, + { name: 'G155', rating: 4 }, + { name: 'G156', rating: 4 }, + { name: 'G157', rating: 4 }, + { name: 'G158', rating: 4 }, + { name: 'G159', rating: 4 }, + { name: 'G160', rating: 4 }, + { name: 'G161', rating: 4 }, + { name: 'G162', rating: 4 }, + { name: 'G163', rating: 4 }, + { name: 'G164', rating: 4 }, + { name: 'G165', rating: 4 }, + { name: 'G166', rating: 4 }, + { name: 'G167', rating: 4 }, + { name: 'G168', rating: 4 }, + { name: 'G169', rating: 4 }, + { name: 'G170', rating: 4 }, + { name: 'G171', rating: 4 }, + { name: 'G172', rating: 4 }, + { name: 'G173', rating: 4 }, + { name: 'G174', rating: 4 }, + { name: 'G175', rating: 4 }, + { name: 'G176', rating: 4 }, + { name: 'G177', rating: 4 }, + { name: 'G178', rating: 4 }, + { name: 'G179', rating: 4 }, + { name: 'G180', rating: 4 }, + { name: 'G181', rating: 4 }, + { name: 'G182', rating: 4 }, + { name: 'G183', rating: 4 }, + { name: 'G184', rating: 4 }, + { name: 'G185', rating: 4 }, + { name: 'G186', rating: 4 }, + { name: 'H000', rating: 3 }, + { name: 'H001', rating: 3 }, + { name: 'H002', rating: 3 }, + { name: 'H003', rating: 3 }, + { name: 'H004', rating: 3 }, + { name: 'H005', rating: 3 }, + { name: 'H006', rating: 3 }, + { name: 'H007', rating: 3 }, + { name: 'H008', rating: 3 }, + { name: 'H009', rating: 3 }, + { name: 'H010', rating: 3 }, + { name: 'H011', rating: 3 }, + { name: 'H012', rating: 3 }, + { name: 'H013', rating: 3 }, + { name: 'H014', rating: 3 }, + { name: 'H015', rating: 3 }, + { name: 'H016', rating: 3 }, + { name: 'H017', rating: 3 }, + { name: 'H018', rating: 3 }, + { name: 'H019', rating: 3 }, + { name: 'H020', rating: 3 }, + { name: 'H021', rating: 3 }, + { name: 'H022', rating: 3 }, + { name: 'H023', rating: 3 }, + { name: 'H024', rating: 3 }, + { name: 'H025', rating: 3 }, + { name: 'H026', rating: 3 }, + { name: 'H027', rating: 3 }, + { name: 'H028', rating: 3 }, + { name: 'H029', rating: 3 }, + { name: 'H030', rating: 3 }, + { name: 'H031', rating: 3 }, + { name: 'H032', rating: 3 }, + { name: 'H033', rating: 3 }, + { name: 'H034', rating: 3 }, + { name: 'H035', rating: 3 }, + { name: 'H036', rating: 3 }, + { name: 'H037', rating: 3 }, + { name: 'H038', rating: 3 }, + { name: 'H039', rating: 3 }, + { name: 'H040', rating: 3 }, + { name: 'H041', rating: 3 }, + { name: 'H042', rating: 3 }, + { name: 'H043', rating: 3 }, + { name: 'H044', rating: 3 }, + { name: 'H045', rating: 3 }, + { name: 'H046', rating: 3 }, + { name: 'H047', rating: 3 }, + { name: 'H048', rating: 3 }, + { name: 'H049', rating: 3 }, + { name: 'H050', rating: 3 }, + { name: 'H051', rating: 3 }, + { name: 'H052', rating: 3 }, + { name: 'H053', rating: 3 }, + { name: 'H054', rating: 3 }, + { name: 'H055', rating: 3 }, + { name: 'H056', rating: 3 }, + { name: 'H057', rating: 3 }, + { name: 'H058', rating: 3 }, + { name: 'H059', rating: 3 }, + { name: 'H060', rating: 3 }, + { name: 'H061', rating: 3 }, + { name: 'H062', rating: 3 }, + { name: 'H063', rating: 3 }, + { name: 'H064', rating: 3 }, + { name: 'H065', rating: 3 }, + { name: 'H066', rating: 3 }, + { name: 'H067', rating: 3 }, + { name: 'H068', rating: 3 }, + { name: 'H069', rating: 3 }, + { name: 'H070', rating: 3 }, + { name: 'H071', rating: 3 }, + { name: 'H072', rating: 3 }, + { name: 'H073', rating: 3 }, + { name: 'H074', rating: 3 }, + { name: 'H075', rating: 3 }, + { name: 'H076', rating: 3 }, + { name: 'H077', rating: 3 }, + { name: 'H078', rating: 3 }, + { name: 'H079', rating: 3 }, + { name: 'H080', rating: 3 }, + { name: 'H081', rating: 3 }, + { name: 'H082', rating: 3 }, + { name: 'H083', rating: 3 }, + { name: 'H084', rating: 3 }, + { name: 'H085', rating: 3 }, + { name: 'H086', rating: 3 }, + { name: 'H087', rating: 3 }, + { name: 'H088', rating: 3 }, + { name: 'H089', rating: 3 }, + { name: 'H090', rating: 3 }, + { name: 'H091', rating: 3 }, + { name: 'H092', rating: 3 }, + { name: 'H093', rating: 3 }, + { name: 'H094', rating: 3 }, + { name: 'H095', rating: 3 }, + { name: 'H096', rating: 3 }, + { name: 'H097', rating: 3 }, + { name: 'H098', rating: 3 }, + { name: 'H099', rating: 3 }, + { name: 'H100', rating: 3 }, + { name: 'H101', rating: 3 }, + { name: 'H102', rating: 3 }, + { name: 'H103', rating: 3 }, + { name: 'H104', rating: 3 }, + { name: 'H105', rating: 3 }, + { name: 'H106', rating: 3 }, + { name: 'H107', rating: 3 }, + { name: 'H108', rating: 3 }, + { name: 'H109', rating: 3 }, + { name: 'H110', rating: 3 }, + { name: 'H111', rating: 3 }, + { name: 'H112', rating: 3 }, + { name: 'H113', rating: 3 }, + { name: 'H114', rating: 3 }, + { name: 'H115', rating: 3 }, + { name: 'H116', rating: 3 }, + { name: 'H117', rating: 3 }, + { name: 'H118', rating: 3 }, + { name: 'H119', rating: 3 }, + { name: 'H120', rating: 3 }, + { name: 'H121', rating: 3 }, + { name: 'H122', rating: 3 }, + { name: 'H123', rating: 3 }, + { name: 'H124', rating: 3 }, + { name: 'H125', rating: 3 }, + { name: 'H126', rating: 3 }, + { name: 'H127', rating: 3 }, + { name: 'H128', rating: 3 }, + { name: 'H129', rating: 3 }, + { name: 'H130', rating: 3 }, + { name: 'H131', rating: 3 }, + { name: 'H132', rating: 3 }, + { name: 'H133', rating: 3 }, + { name: 'H134', rating: 3 }, + { name: 'H135', rating: 3 }, + { name: 'H136', rating: 3 }, + { name: 'H137', rating: 3 }, + { name: 'H138', rating: 3 }, + { name: 'H139', rating: 3 }, + { name: 'H140', rating: 3 }, + { name: 'H141', rating: 3 }, + { name: 'H142', rating: 3 }, + { name: 'H143', rating: 3 }, + { name: 'H144', rating: 3 }, + { name: 'H145', rating: 3 }, + { name: 'H146', rating: 3 }, + { name: 'H147', rating: 3 }, + { name: 'H148', rating: 3 }, + { name: 'H149', rating: 3 }, + { name: 'H150', rating: 3 }, + { name: 'H151', rating: 3 }, + { name: 'H152', rating: 3 }, + { name: 'H153', rating: 3 }, + { name: 'H154', rating: 3 }, + { name: 'H155', rating: 3 }, + { name: 'H156', rating: 3 }, + { name: 'H157', rating: 3 }, + { name: 'H158', rating: 3 }, + { name: 'H159', rating: 3 }, + { name: 'H160', rating: 3 }, + { name: 'H161', rating: 3 }, + { name: 'H162', rating: 3 }, + { name: 'H163', rating: 3 }, + { name: 'H164', rating: 3 }, + { name: 'H165', rating: 3 }, + { name: 'H166', rating: 3 }, + { name: 'H167', rating: 3 }, + { name: 'H168', rating: 3 }, + { name: 'H169', rating: 3 }, + { name: 'H170', rating: 3 }, + { name: 'H171', rating: 3 }, + { name: 'H172', rating: 3 }, + { name: 'H173', rating: 3 }, + { name: 'H174', rating: 3 }, + { name: 'H175', rating: 3 }, + { name: 'H176', rating: 3 }, + { name: 'H177', rating: 3 }, + { name: 'H178', rating: 3 }, + { name: 'H179', rating: 3 }, + { name: 'H180', rating: 3 }, + { name: 'H181', rating: 3 }, + { name: 'H182', rating: 3 }, + { name: 'H183', rating: 3 }, + { name: 'H184', rating: 3 }, + { name: 'H185', rating: 3 }, + { name: 'H186', rating: 3 }, + { name: 'I000', rating: 2 }, + { name: 'I001', rating: 2 }, + { name: 'I002', rating: 2 }, + { name: 'I003', rating: 2 }, + { name: 'I004', rating: 2 }, + { name: 'I005', rating: 2 }, + { name: 'I006', rating: 2 }, + { name: 'I007', rating: 2 }, + { name: 'I008', rating: 2 }, + { name: 'I009', rating: 2 }, + { name: 'I010', rating: 2 }, + { name: 'I011', rating: 2 }, + { name: 'I012', rating: 2 }, + { name: 'I013', rating: 2 }, + { name: 'I014', rating: 2 }, + { name: 'I015', rating: 2 }, + { name: 'I016', rating: 2 }, + { name: 'I017', rating: 2 }, + { name: 'I018', rating: 2 }, + { name: 'I019', rating: 2 }, + { name: 'I020', rating: 2 }, + { name: 'I021', rating: 2 }, + { name: 'I022', rating: 2 }, + { name: 'I023', rating: 2 }, + { name: 'I024', rating: 2 }, + { name: 'I025', rating: 2 }, + { name: 'I026', rating: 2 }, + { name: 'I027', rating: 2 }, + { name: 'I028', rating: 2 }, + { name: 'I029', rating: 2 }, + { name: 'I030', rating: 2 }, + { name: 'I031', rating: 2 }, + { name: 'I032', rating: 2 }, + { name: 'I033', rating: 2 }, + { name: 'I034', rating: 2 }, + { name: 'I035', rating: 2 }, + { name: 'I036', rating: 2 }, + { name: 'I037', rating: 2 }, + { name: 'I038', rating: 2 }, + { name: 'I039', rating: 2 }, + { name: 'I040', rating: 2 }, + { name: 'I041', rating: 2 }, + { name: 'I042', rating: 2 }, + { name: 'I043', rating: 2 }, + { name: 'I044', rating: 2 }, + { name: 'I045', rating: 2 }, + { name: 'I046', rating: 2 }, + { name: 'I047', rating: 2 }, + { name: 'I048', rating: 2 }, + { name: 'I049', rating: 2 }, + { name: 'I050', rating: 2 }, + { name: 'I051', rating: 2 }, + { name: 'I052', rating: 2 }, + { name: 'I053', rating: 2 }, + { name: 'I054', rating: 2 }, + { name: 'I055', rating: 2 }, + { name: 'I056', rating: 2 }, + { name: 'I057', rating: 2 }, + { name: 'I058', rating: 2 }, + { name: 'I059', rating: 2 }, + { name: 'I060', rating: 2 }, + { name: 'I061', rating: 2 }, + { name: 'I062', rating: 2 }, + { name: 'I063', rating: 2 }, + { name: 'I064', rating: 2 }, + { name: 'I065', rating: 2 }, + { name: 'I066', rating: 2 }, + { name: 'I067', rating: 2 }, + { name: 'I068', rating: 2 }, + { name: 'I069', rating: 2 }, + { name: 'I070', rating: 2 }, + { name: 'I071', rating: 2 }, + { name: 'I072', rating: 2 }, + { name: 'I073', rating: 2 }, + { name: 'I074', rating: 2 }, + { name: 'I075', rating: 2 }, + { name: 'I076', rating: 2 }, + { name: 'I077', rating: 2 }, + { name: 'I078', rating: 2 }, + { name: 'I079', rating: 2 }, + { name: 'I080', rating: 2 }, + { name: 'I081', rating: 2 }, + { name: 'I082', rating: 2 }, + { name: 'I083', rating: 2 }, + { name: 'I084', rating: 2 }, + { name: 'I085', rating: 2 }, + { name: 'I086', rating: 2 }, + { name: 'I087', rating: 2 }, + { name: 'I088', rating: 2 }, + { name: 'I089', rating: 2 }, + { name: 'I090', rating: 2 }, + { name: 'I091', rating: 2 }, + { name: 'I092', rating: 2 }, + { name: 'I093', rating: 2 }, + { name: 'I094', rating: 2 }, + { name: 'I095', rating: 2 }, + { name: 'I096', rating: 2 }, + { name: 'I097', rating: 2 }, + { name: 'I098', rating: 2 }, + { name: 'I099', rating: 2 }, + { name: 'I100', rating: 2 }, + { name: 'I101', rating: 2 }, + { name: 'I102', rating: 2 }, + { name: 'I103', rating: 2 }, + { name: 'I104', rating: 2 }, + { name: 'I105', rating: 2 }, + { name: 'I106', rating: 2 }, + { name: 'I107', rating: 2 }, + { name: 'I108', rating: 2 }, + { name: 'I109', rating: 2 }, + { name: 'I110', rating: 2 }, + { name: 'I111', rating: 2 }, + { name: 'I112', rating: 2 }, + { name: 'I113', rating: 2 }, + { name: 'I114', rating: 2 }, + { name: 'I115', rating: 2 }, + { name: 'I116', rating: 2 }, + { name: 'I117', rating: 2 }, + { name: 'I118', rating: 2 }, + { name: 'I119', rating: 2 }, + { name: 'I120', rating: 2 }, + { name: 'I121', rating: 2 }, + { name: 'I122', rating: 2 }, + { name: 'I123', rating: 2 }, + { name: 'I124', rating: 2 }, + { name: 'I125', rating: 2 }, + { name: 'I126', rating: 2 }, + { name: 'I127', rating: 2 }, + { name: 'I128', rating: 2 }, + { name: 'I129', rating: 2 }, + { name: 'I130', rating: 2 }, + { name: 'I131', rating: 2 }, + { name: 'I132', rating: 2 }, + { name: 'I133', rating: 2 }, + { name: 'I134', rating: 2 }, + { name: 'I135', rating: 2 }, + { name: 'I136', rating: 2 }, + { name: 'I137', rating: 2 }, + { name: 'I138', rating: 2 }, + { name: 'I139', rating: 2 }, + { name: 'I140', rating: 2 }, + { name: 'I141', rating: 2 }, + { name: 'I142', rating: 2 }, + { name: 'I143', rating: 2 }, + { name: 'I144', rating: 2 }, + { name: 'I145', rating: 2 }, + { name: 'I146', rating: 2 }, + { name: 'I147', rating: 2 }, + { name: 'I148', rating: 2 }, + { name: 'I149', rating: 2 }, + { name: 'I150', rating: 2 }, + { name: 'I151', rating: 2 }, + { name: 'I152', rating: 2 }, + { name: 'I153', rating: 2 }, + { name: 'I154', rating: 2 }, + { name: 'I155', rating: 2 }, + { name: 'I156', rating: 2 }, + { name: 'I157', rating: 2 }, + { name: 'I158', rating: 2 }, + { name: 'I159', rating: 2 }, + { name: 'I160', rating: 2 }, + { name: 'I161', rating: 2 }, + { name: 'I162', rating: 2 }, + { name: 'I163', rating: 2 }, + { name: 'I164', rating: 2 }, + { name: 'I165', rating: 2 }, + { name: 'I166', rating: 2 }, + { name: 'I167', rating: 2 }, + { name: 'I168', rating: 2 }, + { name: 'I169', rating: 2 }, + { name: 'I170', rating: 2 }, + { name: 'I171', rating: 2 }, + { name: 'I172', rating: 2 }, + { name: 'I173', rating: 2 }, + { name: 'I174', rating: 2 }, + { name: 'I175', rating: 2 }, + { name: 'I176', rating: 2 }, + { name: 'I177', rating: 2 }, + { name: 'I178', rating: 2 }, + { name: 'I179', rating: 2 }, + { name: 'I180', rating: 2 }, + { name: 'I181', rating: 2 }, + { name: 'I182', rating: 2 }, + { name: 'I183', rating: 2 }, + { name: 'I184', rating: 2 }, + { name: 'I185', rating: 2 }, + { name: 'I186', rating: 2 }, + { name: 'J000', rating: 2 }, + { name: 'J001', rating: 2 }, + { name: 'J002', rating: 2 }, + { name: 'J003', rating: 2 }, + { name: 'J004', rating: 2 }, + { name: 'J005', rating: 2 }, + { name: 'J006', rating: 2 }, + { name: 'J007', rating: 2 }, + { name: 'J008', rating: 2 }, + { name: 'J009', rating: 2 }, + { name: 'J010', rating: 2 }, + { name: 'J011', rating: 2 }, + { name: 'J012', rating: 2 }, + { name: 'J013', rating: 2 }, + { name: 'J014', rating: 2 }, + { name: 'J015', rating: 2 }, + { name: 'J016', rating: 2 }, + { name: 'J017', rating: 2 }, + { name: 'J018', rating: 2 }, + { name: 'J019', rating: 2 }, + { name: 'J020', rating: 2 }, + { name: 'J021', rating: 2 }, + { name: 'J022', rating: 2 }, + { name: 'J023', rating: 2 }, + { name: 'J024', rating: 2 }, + { name: 'J025', rating: 2 }, + { name: 'J026', rating: 2 }, + { name: 'J027', rating: 2 }, + { name: 'J028', rating: 2 }, + { name: 'J029', rating: 2 }, + { name: 'J030', rating: 2 }, + { name: 'J031', rating: 2 }, + { name: 'J032', rating: 2 }, + { name: 'J033', rating: 2 }, + { name: 'J034', rating: 2 }, + { name: 'J035', rating: 2 }, + { name: 'J036', rating: 2 }, + { name: 'J037', rating: 2 }, + { name: 'J038', rating: 2 }, + { name: 'J039', rating: 2 }, + { name: 'J040', rating: 2 }, + { name: 'J041', rating: 2 }, + { name: 'J042', rating: 2 }, + { name: 'J043', rating: 2 }, + { name: 'J044', rating: 2 }, + { name: 'J045', rating: 2 }, + { name: 'J046', rating: 2 }, + { name: 'J047', rating: 2 }, + { name: 'J048', rating: 2 }, + { name: 'J049', rating: 2 }, + { name: 'J050', rating: 2 }, + { name: 'J051', rating: 2 }, + { name: 'J052', rating: 2 }, + { name: 'J053', rating: 2 }, + { name: 'J054', rating: 2 }, + { name: 'J055', rating: 2 }, + { name: 'J056', rating: 2 }, + { name: 'J057', rating: 2 }, + { name: 'J058', rating: 2 }, + { name: 'J059', rating: 2 }, + { name: 'J060', rating: 2 }, + { name: 'J061', rating: 2 }, + { name: 'J062', rating: 2 }, + { name: 'J063', rating: 2 }, + { name: 'J064', rating: 2 }, + { name: 'J065', rating: 2 }, + { name: 'J066', rating: 2 }, + { name: 'J067', rating: 2 }, + { name: 'J068', rating: 2 }, + { name: 'J069', rating: 2 }, + { name: 'J070', rating: 2 }, + { name: 'J071', rating: 2 }, + { name: 'J072', rating: 2 }, + { name: 'J073', rating: 2 }, + { name: 'J074', rating: 2 }, + { name: 'J075', rating: 2 }, + { name: 'J076', rating: 2 }, + { name: 'J077', rating: 2 }, + { name: 'J078', rating: 2 }, + { name: 'J079', rating: 2 }, + { name: 'J080', rating: 2 }, + { name: 'J081', rating: 2 }, + { name: 'J082', rating: 2 }, + { name: 'J083', rating: 2 }, + { name: 'J084', rating: 2 }, + { name: 'J085', rating: 2 }, + { name: 'J086', rating: 2 }, + { name: 'J087', rating: 2 }, + { name: 'J088', rating: 2 }, + { name: 'J089', rating: 2 }, + { name: 'J090', rating: 2 }, + { name: 'J091', rating: 2 }, + { name: 'J092', rating: 2 }, + { name: 'J093', rating: 2 }, + { name: 'J094', rating: 2 }, + { name: 'J095', rating: 2 }, + { name: 'J096', rating: 2 }, + { name: 'J097', rating: 2 }, + { name: 'J098', rating: 2 }, + { name: 'J099', rating: 2 }, + { name: 'J100', rating: 2 }, + { name: 'J101', rating: 2 }, + { name: 'J102', rating: 2 }, + { name: 'J103', rating: 2 }, + { name: 'J104', rating: 2 }, + { name: 'J105', rating: 2 }, + { name: 'J106', rating: 2 }, + { name: 'J107', rating: 2 }, + { name: 'J108', rating: 2 }, + { name: 'J109', rating: 2 }, + { name: 'J110', rating: 2 }, + { name: 'J111', rating: 2 }, + { name: 'J112', rating: 2 }, + { name: 'J113', rating: 2 }, + { name: 'J114', rating: 2 }, + { name: 'J115', rating: 2 }, + { name: 'J116', rating: 2 }, + { name: 'J117', rating: 2 }, + { name: 'J118', rating: 2 }, + { name: 'J119', rating: 2 }, + { name: 'J120', rating: 2 }, + { name: 'J121', rating: 2 }, + { name: 'J122', rating: 2 }, + { name: 'J123', rating: 2 }, + { name: 'J124', rating: 2 }, + { name: 'J125', rating: 2 }, + { name: 'J126', rating: 2 }, + { name: 'J127', rating: 2 }, + { name: 'J128', rating: 2 }, + { name: 'J129', rating: 2 }, + { name: 'J130', rating: 2 }, + { name: 'J131', rating: 2 }, + { name: 'J132', rating: 2 }, + { name: 'J133', rating: 2 }, + { name: 'J134', rating: 2 }, + { name: 'J135', rating: 2 }, + { name: 'J136', rating: 2 }, + { name: 'J137', rating: 2 }, + { name: 'J138', rating: 2 }, + { name: 'J139', rating: 2 }, + { name: 'J140', rating: 2 }, + { name: 'J141', rating: 2 }, + { name: 'J142', rating: 2 }, + { name: 'J143', rating: 2 }, + { name: 'J144', rating: 2 }, + { name: 'J145', rating: 2 }, + { name: 'J146', rating: 2 }, + { name: 'J147', rating: 2 }, + { name: 'J148', rating: 2 }, + { name: 'J149', rating: 2 }, + { name: 'J150', rating: 2 }, + { name: 'J151', rating: 2 }, + { name: 'J152', rating: 2 }, + { name: 'J153', rating: 2 }, + { name: 'J154', rating: 2 }, + { name: 'J155', rating: 2 }, + { name: 'J156', rating: 2 }, + { name: 'J157', rating: 2 }, + { name: 'J158', rating: 2 }, + { name: 'J159', rating: 2 }, + { name: 'J160', rating: 2 }, + { name: 'J161', rating: 2 }, + { name: 'J162', rating: 2 }, + { name: 'J163', rating: 2 }, + { name: 'J164', rating: 2 }, + { name: 'J165', rating: 2 }, + { name: 'J166', rating: 2 }, + { name: 'J167', rating: 2 }, + { name: 'J168', rating: 2 }, + { name: 'J169', rating: 2 }, + { name: 'J170', rating: 2 }, + { name: 'J171', rating: 2 }, + { name: 'J172', rating: 2 }, + { name: 'J173', rating: 2 }, + { name: 'J174', rating: 2 }, + { name: 'J175', rating: 2 }, + { name: 'J176', rating: 2 }, + { name: 'J177', rating: 2 }, + { name: 'J178', rating: 2 }, + { name: 'J179', rating: 2 }, + { name: 'J180', rating: 2 }, + { name: 'J181', rating: 2 }, + { name: 'J182', rating: 2 }, + { name: 'J183', rating: 2 }, + { name: 'J184', rating: 2 }, + { name: 'J185', rating: 2 }, + { name: 'J186', rating: 2 }, + { name: 'K000', rating: 2 }, + { name: 'K001', rating: 2 }, + { name: 'K002', rating: 2 }, + { name: 'K003', rating: 2 }, + { name: 'K004', rating: 2 }, + { name: 'K005', rating: 2 }, + { name: 'K006', rating: 2 }, + { name: 'K007', rating: 2 }, + { name: 'K008', rating: 2 }, + { name: 'K009', rating: 2 }, + { name: 'K010', rating: 2 }, + { name: 'K011', rating: 2 }, + { name: 'K012', rating: 2 }, + { name: 'K013', rating: 2 }, + { name: 'K014', rating: 2 }, + { name: 'K015', rating: 2 }, + { name: 'K016', rating: 2 }, + { name: 'K017', rating: 2 }, + { name: 'K018', rating: 2 }, + { name: 'K019', rating: 2 }, + { name: 'K020', rating: 2 }, + { name: 'K021', rating: 2 }, + { name: 'K022', rating: 2 }, + { name: 'K023', rating: 2 }, + { name: 'K024', rating: 2 }, + { name: 'K025', rating: 2 }, + { name: 'K026', rating: 2 }, + { name: 'K027', rating: 2 }, + { name: 'K028', rating: 2 }, + { name: 'K029', rating: 2 }, + { name: 'K030', rating: 2 }, + { name: 'K031', rating: 2 }, + { name: 'K032', rating: 2 }, + { name: 'K033', rating: 2 }, + { name: 'K034', rating: 2 }, + { name: 'K035', rating: 2 }, + { name: 'K036', rating: 2 }, + { name: 'K037', rating: 2 }, + { name: 'K038', rating: 2 }, + { name: 'K039', rating: 2 }, + { name: 'K040', rating: 2 }, + { name: 'K041', rating: 2 }, + { name: 'K042', rating: 2 }, + { name: 'K043', rating: 2 }, + { name: 'K044', rating: 2 }, + { name: 'K045', rating: 2 }, + { name: 'K046', rating: 2 }, + { name: 'K047', rating: 2 }, + { name: 'K048', rating: 2 }, + { name: 'K049', rating: 2 }, + { name: 'K050', rating: 2 }, + { name: 'K051', rating: 2 }, + { name: 'K052', rating: 2 }, + { name: 'K053', rating: 2 }, + { name: 'K054', rating: 2 }, + { name: 'K055', rating: 2 }, + { name: 'K056', rating: 2 }, + { name: 'K057', rating: 2 }, + { name: 'K058', rating: 2 }, + { name: 'K059', rating: 2 }, + { name: 'K060', rating: 2 }, + { name: 'K061', rating: 2 }, + { name: 'K062', rating: 2 }, + { name: 'K063', rating: 2 }, + { name: 'K064', rating: 2 }, + { name: 'K065', rating: 2 }, + { name: 'K066', rating: 2 }, + { name: 'K067', rating: 2 }, + { name: 'K068', rating: 2 }, + { name: 'K069', rating: 2 }, + { name: 'K070', rating: 2 }, + { name: 'K071', rating: 2 }, + { name: 'K072', rating: 2 }, + { name: 'K073', rating: 2 }, + { name: 'K074', rating: 2 }, + { name: 'K075', rating: 2 }, + { name: 'K076', rating: 2 }, + { name: 'K077', rating: 2 }, + { name: 'K078', rating: 2 }, + { name: 'K079', rating: 2 }, + { name: 'K080', rating: 2 }, + { name: 'K081', rating: 2 }, + { name: 'K082', rating: 2 }, + { name: 'K083', rating: 2 }, + { name: 'K084', rating: 2 }, + { name: 'K085', rating: 2 }, + { name: 'K086', rating: 2 }, + { name: 'K087', rating: 2 }, + { name: 'K088', rating: 2 }, + { name: 'K089', rating: 2 }, + { name: 'K090', rating: 2 }, + { name: 'K091', rating: 2 }, + { name: 'K092', rating: 2 }, + { name: 'K093', rating: 2 }, + { name: 'K094', rating: 2 }, + { name: 'K095', rating: 2 }, + { name: 'K096', rating: 2 }, + { name: 'K097', rating: 2 }, + { name: 'K098', rating: 2 }, + { name: 'K099', rating: 2 }, + { name: 'K100', rating: 2 }, + { name: 'K101', rating: 2 }, + { name: 'K102', rating: 2 }, + { name: 'K103', rating: 2 }, + { name: 'K104', rating: 2 }, + { name: 'K105', rating: 2 }, + { name: 'K106', rating: 2 }, + { name: 'K107', rating: 2 }, + { name: 'K108', rating: 2 }, + { name: 'K109', rating: 2 }, + { name: 'K110', rating: 2 }, + { name: 'K111', rating: 2 }, + { name: 'K112', rating: 2 }, + { name: 'K113', rating: 2 }, + { name: 'K114', rating: 2 }, + { name: 'K115', rating: 2 }, + { name: 'K116', rating: 2 }, + { name: 'K117', rating: 2 }, + { name: 'K118', rating: 2 }, + { name: 'K119', rating: 2 }, + { name: 'K120', rating: 2 }, + { name: 'K121', rating: 2 }, + { name: 'K122', rating: 2 }, + { name: 'K123', rating: 2 }, + { name: 'K124', rating: 2 }, + { name: 'K125', rating: 2 }, + { name: 'K126', rating: 2 }, + { name: 'K127', rating: 2 }, + { name: 'K128', rating: 2 }, + { name: 'K129', rating: 2 }, + { name: 'K130', rating: 2 }, + { name: 'K131', rating: 2 }, + { name: 'K132', rating: 2 }, + { name: 'K133', rating: 2 }, + { name: 'K134', rating: 2 }, + { name: 'K135', rating: 2 }, + { name: 'K136', rating: 2 }, + { name: 'K137', rating: 2 }, + { name: 'K138', rating: 2 }, + { name: 'K139', rating: 2 }, + { name: 'K140', rating: 2 }, + { name: 'K141', rating: 2 }, + { name: 'K142', rating: 2 }, + { name: 'K143', rating: 2 }, + { name: 'K144', rating: 2 }, + { name: 'K145', rating: 2 }, + { name: 'K146', rating: 2 }, + { name: 'K147', rating: 2 }, + { name: 'K148', rating: 2 }, + { name: 'K149', rating: 2 }, + { name: 'K150', rating: 2 }, + { name: 'K151', rating: 2 }, + { name: 'K152', rating: 2 }, + { name: 'K153', rating: 2 }, + { name: 'K154', rating: 2 }, + { name: 'K155', rating: 2 }, + { name: 'K156', rating: 2 }, + { name: 'K157', rating: 2 }, + { name: 'K158', rating: 2 }, + { name: 'K159', rating: 2 }, + { name: 'K160', rating: 2 }, + { name: 'K161', rating: 2 }, + { name: 'K162', rating: 2 }, + { name: 'K163', rating: 2 }, + { name: 'K164', rating: 2 }, + { name: 'K165', rating: 2 }, + { name: 'K166', rating: 2 }, + { name: 'K167', rating: 2 }, + { name: 'K168', rating: 2 }, + { name: 'K169', rating: 2 }, + { name: 'K170', rating: 2 }, + { name: 'K171', rating: 2 }, + { name: 'K172', rating: 2 }, + { name: 'K173', rating: 2 }, + { name: 'K174', rating: 2 }, + { name: 'K175', rating: 2 }, + { name: 'K176', rating: 2 }, + { name: 'K177', rating: 2 }, +]; +assert.sameValue(array.length, 2048); + +// Sort the elements by `rating` in descending order. +// (This updates `array` in place.) +array.sort((a, b) => b.rating - a.rating); + +const reduced = array.reduce((acc, element) => { + const letter = element.name.slice(0, 1); + const previousLetter = acc.slice(-1); + if (previousLetter === letter) { + return acc; + } + return acc + letter; +}, ''); +assert.sameValue(reduced, 'DGBEFHACIJK'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/sort/stability-5-elements.js b/js/src/tests/test262/built-ins/Array/prototype/sort/stability-5-elements.js new file mode 100644 index 000000000000..76285695db54 --- /dev/null +++ b/js/src/tests/test262/built-ins/Array/prototype/sort/stability-5-elements.js @@ -0,0 +1,29 @@ +// Copyright (C) 2018 Mathias Bynens. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.sort +description: > + Stability of Array.prototype.sort for an array with 5 elements. +info: | + The sort is required to be stable (that is, elements that compare equal + remain in their original order). +---*/ + +const array = [ + { name: 'A', rating: 2 }, + { name: 'B', rating: 3 }, + { name: 'C', rating: 2 }, + { name: 'D', rating: 3 }, + { name: 'E', rating: 3 }, +]; +assert.sameValue(array.length, 5); + +// Sort the elements by `rating` in descending order. +// (This updates `array` in place.) +array.sort((a, b) => b.rating - a.rating); + +const reduced = array.reduce((acc, element) => acc + element.name, ''); +assert.sameValue(reduced, 'BDEAC'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Array/prototype/sort/stability-513-elements.js b/js/src/tests/test262/built-ins/Array/prototype/sort/stability-513-elements.js new file mode 100644 index 000000000000..8662a6d2647c --- /dev/null +++ b/js/src/tests/test262/built-ins/Array/prototype/sort/stability-513-elements.js @@ -0,0 +1,548 @@ +// Copyright (C) 2018 Mathias Bynens. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.prototype.sort +description: > + Stability of Array.prototype.sort for an array with 513 elements. +info: | + The sort is required to be stable (that is, elements that compare equal + remain in their original order). + The array length of 513 was chosen because until late 2018, Chakra + used to apply an unstable QuickSort for arrays with more than 512 + elements, although it used a stable insertion sort for anything else. + https://github.com/Microsoft/ChakraCore/pull/5724 +---*/ + +const array = [ + { name: 'A00', rating: 2 }, + { name: 'A01', rating: 2 }, + { name: 'A02', rating: 2 }, + { name: 'A03', rating: 2 }, + { name: 'A04', rating: 2 }, + { name: 'A05', rating: 2 }, + { name: 'A06', rating: 2 }, + { name: 'A07', rating: 2 }, + { name: 'A08', rating: 2 }, + { name: 'A09', rating: 2 }, + { name: 'A10', rating: 2 }, + { name: 'A11', rating: 2 }, + { name: 'A12', rating: 2 }, + { name: 'A13', rating: 2 }, + { name: 'A14', rating: 2 }, + { name: 'A15', rating: 2 }, + { name: 'A16', rating: 2 }, + { name: 'A17', rating: 2 }, + { name: 'A18', rating: 2 }, + { name: 'A19', rating: 2 }, + { name: 'A20', rating: 2 }, + { name: 'A21', rating: 2 }, + { name: 'A22', rating: 2 }, + { name: 'A23', rating: 2 }, + { name: 'A24', rating: 2 }, + { name: 'A25', rating: 2 }, + { name: 'A26', rating: 2 }, + { name: 'A27', rating: 2 }, + { name: 'A28', rating: 2 }, + { name: 'A29', rating: 2 }, + { name: 'A30', rating: 2 }, + { name: 'A31', rating: 2 }, + { name: 'A32', rating: 2 }, + { name: 'A33', rating: 2 }, + { name: 'A34', rating: 2 }, + { name: 'A35', rating: 2 }, + { name: 'A36', rating: 2 }, + { name: 'A37', rating: 2 }, + { name: 'A38', rating: 2 }, + { name: 'A39', rating: 2 }, + { name: 'A40', rating: 2 }, + { name: 'A41', rating: 2 }, + { name: 'A42', rating: 2 }, + { name: 'A43', rating: 2 }, + { name: 'A44', rating: 2 }, + { name: 'A45', rating: 2 }, + { name: 'A46', rating: 2 }, + { name: 'B00', rating: 3 }, + { name: 'B01', rating: 3 }, + { name: 'B02', rating: 3 }, + { name: 'B03', rating: 3 }, + { name: 'B04', rating: 3 }, + { name: 'B05', rating: 3 }, + { name: 'B06', rating: 3 }, + { name: 'B07', rating: 3 }, + { name: 'B08', rating: 3 }, + { name: 'B09', rating: 3 }, + { name: 'B10', rating: 3 }, + { name: 'B11', rating: 3 }, + { name: 'B12', rating: 3 }, + { name: 'B13', rating: 3 }, + { name: 'B14', rating: 3 }, + { name: 'B15', rating: 3 }, + { name: 'B16', rating: 3 }, + { name: 'B17', rating: 3 }, + { name: 'B18', rating: 3 }, + { name: 'B19', rating: 3 }, + { name: 'B20', rating: 3 }, + { name: 'B21', rating: 3 }, + { name: 'B22', rating: 3 }, + { name: 'B23', rating: 3 }, + { name: 'B24', rating: 3 }, + { name: 'B25', rating: 3 }, + { name: 'B26', rating: 3 }, + { name: 'B27', rating: 3 }, + { name: 'B28', rating: 3 }, + { name: 'B29', rating: 3 }, + { name: 'B30', rating: 3 }, + { name: 'B31', rating: 3 }, + { name: 'B32', rating: 3 }, + { name: 'B33', rating: 3 }, + { name: 'B34', rating: 3 }, + { name: 'B35', rating: 3 }, + { name: 'B36', rating: 3 }, + { name: 'B37', rating: 3 }, + { name: 'B38', rating: 3 }, + { name: 'B39', rating: 3 }, + { name: 'B40', rating: 3 }, + { name: 'B41', rating: 3 }, + { name: 'B42', rating: 3 }, + { name: 'B43', rating: 3 }, + { name: 'B44', rating: 3 }, + { name: 'B45', rating: 3 }, + { name: 'B46', rating: 3 }, + { name: 'C00', rating: 2 }, + { name: 'C01', rating: 2 }, + { name: 'C02', rating: 2 }, + { name: 'C03', rating: 2 }, + { name: 'C04', rating: 2 }, + { name: 'C05', rating: 2 }, + { name: 'C06', rating: 2 }, + { name: 'C07', rating: 2 }, + { name: 'C08', rating: 2 }, + { name: 'C09', rating: 2 }, + { name: 'C10', rating: 2 }, + { name: 'C11', rating: 2 }, + { name: 'C12', rating: 2 }, + { name: 'C13', rating: 2 }, + { name: 'C14', rating: 2 }, + { name: 'C15', rating: 2 }, + { name: 'C16', rating: 2 }, + { name: 'C17', rating: 2 }, + { name: 'C18', rating: 2 }, + { name: 'C19', rating: 2 }, + { name: 'C20', rating: 2 }, + { name: 'C21', rating: 2 }, + { name: 'C22', rating: 2 }, + { name: 'C23', rating: 2 }, + { name: 'C24', rating: 2 }, + { name: 'C25', rating: 2 }, + { name: 'C26', rating: 2 }, + { name: 'C27', rating: 2 }, + { name: 'C28', rating: 2 }, + { name: 'C29', rating: 2 }, + { name: 'C30', rating: 2 }, + { name: 'C31', rating: 2 }, + { name: 'C32', rating: 2 }, + { name: 'C33', rating: 2 }, + { name: 'C34', rating: 2 }, + { name: 'C35', rating: 2 }, + { name: 'C36', rating: 2 }, + { name: 'C37', rating: 2 }, + { name: 'C38', rating: 2 }, + { name: 'C39', rating: 2 }, + { name: 'C40', rating: 2 }, + { name: 'C41', rating: 2 }, + { name: 'C42', rating: 2 }, + { name: 'C43', rating: 2 }, + { name: 'C44', rating: 2 }, + { name: 'C45', rating: 2 }, + { name: 'C46', rating: 2 }, + { name: 'D00', rating: 4 }, + { name: 'D01', rating: 4 }, + { name: 'D02', rating: 4 }, + { name: 'D03', rating: 4 }, + { name: 'D04', rating: 4 }, + { name: 'D05', rating: 4 }, + { name: 'D06', rating: 4 }, + { name: 'D07', rating: 4 }, + { name: 'D08', rating: 4 }, + { name: 'D09', rating: 4 }, + { name: 'D10', rating: 4 }, + { name: 'D11', rating: 4 }, + { name: 'D12', rating: 4 }, + { name: 'D13', rating: 4 }, + { name: 'D14', rating: 4 }, + { name: 'D15', rating: 4 }, + { name: 'D16', rating: 4 }, + { name: 'D17', rating: 4 }, + { name: 'D18', rating: 4 }, + { name: 'D19', rating: 4 }, + { name: 'D20', rating: 4 }, + { name: 'D21', rating: 4 }, + { name: 'D22', rating: 4 }, + { name: 'D23', rating: 4 }, + { name: 'D24', rating: 4 }, + { name: 'D25', rating: 4 }, + { name: 'D26', rating: 4 }, + { name: 'D27', rating: 4 }, + { name: 'D28', rating: 4 }, + { name: 'D29', rating: 4 }, + { name: 'D30', rating: 4 }, + { name: 'D31', rating: 4 }, + { name: 'D32', rating: 4 }, + { name: 'D33', rating: 4 }, + { name: 'D34', rating: 4 }, + { name: 'D35', rating: 4 }, + { name: 'D36', rating: 4 }, + { name: 'D37', rating: 4 }, + { name: 'D38', rating: 4 }, + { name: 'D39', rating: 4 }, + { name: 'D40', rating: 4 }, + { name: 'D41', rating: 4 }, + { name: 'D42', rating: 4 }, + { name: 'D43', rating: 4 }, + { name: 'D44', rating: 4 }, + { name: 'D45', rating: 4 }, + { name: 'D46', rating: 4 }, + { name: 'E00', rating: 3 }, + { name: 'E01', rating: 3 }, + { name: 'E02', rating: 3 }, + { name: 'E03', rating: 3 }, + { name: 'E04', rating: 3 }, + { name: 'E05', rating: 3 }, + { name: 'E06', rating: 3 }, + { name: 'E07', rating: 3 }, + { name: 'E08', rating: 3 }, + { name: 'E09', rating: 3 }, + { name: 'E10', rating: 3 }, + { name: 'E11', rating: 3 }, + { name: 'E12', rating: 3 }, + { name: 'E13', rating: 3 }, + { name: 'E14', rating: 3 }, + { name: 'E15', rating: 3 }, + { name: 'E16', rating: 3 }, + { name: 'E17', rating: 3 }, + { name: 'E18', rating: 3 }, + { name: 'E19', rating: 3 }, + { name: 'E20', rating: 3 }, + { name: 'E21', rating: 3 }, + { name: 'E22', rating: 3 }, + { name: 'E23', rating: 3 }, + { name: 'E24', rating: 3 }, + { name: 'E25', rating: 3 }, + { name: 'E26', rating: 3 }, + { name: 'E27', rating: 3 }, + { name: 'E28', rating: 3 }, + { name: 'E29', rating: 3 }, + { name: 'E30', rating: 3 }, + { name: 'E31', rating: 3 }, + { name: 'E32', rating: 3 }, + { name: 'E33', rating: 3 }, + { name: 'E34', rating: 3 }, + { name: 'E35', rating: 3 }, + { name: 'E36', rating: 3 }, + { name: 'E37', rating: 3 }, + { name: 'E38', rating: 3 }, + { name: 'E39', rating: 3 }, + { name: 'E40', rating: 3 }, + { name: 'E41', rating: 3 }, + { name: 'E42', rating: 3 }, + { name: 'E43', rating: 3 }, + { name: 'E44', rating: 3 }, + { name: 'E45', rating: 3 }, + { name: 'E46', rating: 3 }, + { name: 'F00', rating: 3 }, + { name: 'F01', rating: 3 }, + { name: 'F02', rating: 3 }, + { name: 'F03', rating: 3 }, + { name: 'F04', rating: 3 }, + { name: 'F05', rating: 3 }, + { name: 'F06', rating: 3 }, + { name: 'F07', rating: 3 }, + { name: 'F08', rating: 3 }, + { name: 'F09', rating: 3 }, + { name: 'F10', rating: 3 }, + { name: 'F11', rating: 3 }, + { name: 'F12', rating: 3 }, + { name: 'F13', rating: 3 }, + { name: 'F14', rating: 3 }, + { name: 'F15', rating: 3 }, + { name: 'F16', rating: 3 }, + { name: 'F17', rating: 3 }, + { name: 'F18', rating: 3 }, + { name: 'F19', rating: 3 }, + { name: 'F20', rating: 3 }, + { name: 'F21', rating: 3 }, + { name: 'F22', rating: 3 }, + { name: 'F23', rating: 3 }, + { name: 'F24', rating: 3 }, + { name: 'F25', rating: 3 }, + { name: 'F26', rating: 3 }, + { name: 'F27', rating: 3 }, + { name: 'F28', rating: 3 }, + { name: 'F29', rating: 3 }, + { name: 'F30', rating: 3 }, + { name: 'F31', rating: 3 }, + { name: 'F32', rating: 3 }, + { name: 'F33', rating: 3 }, + { name: 'F34', rating: 3 }, + { name: 'F35', rating: 3 }, + { name: 'F36', rating: 3 }, + { name: 'F37', rating: 3 }, + { name: 'F38', rating: 3 }, + { name: 'F39', rating: 3 }, + { name: 'F40', rating: 3 }, + { name: 'F41', rating: 3 }, + { name: 'F42', rating: 3 }, + { name: 'F43', rating: 3 }, + { name: 'F44', rating: 3 }, + { name: 'F45', rating: 3 }, + { name: 'F46', rating: 3 }, + { name: 'G00', rating: 4 }, + { name: 'G01', rating: 4 }, + { name: 'G02', rating: 4 }, + { name: 'G03', rating: 4 }, + { name: 'G04', rating: 4 }, + { name: 'G05', rating: 4 }, + { name: 'G06', rating: 4 }, + { name: 'G07', rating: 4 }, + { name: 'G08', rating: 4 }, + { name: 'G09', rating: 4 }, + { name: 'G10', rating: 4 }, + { name: 'G11', rating: 4 }, + { name: 'G12', rating: 4 }, + { name: 'G13', rating: 4 }, + { name: 'G14', rating: 4 }, + { name: 'G15', rating: 4 }, + { name: 'G16', rating: 4 }, + { name: 'G17', rating: 4 }, + { name: 'G18', rating: 4 }, + { name: 'G19', rating: 4 }, + { name: 'G20', rating: 4 }, + { name: 'G21', rating: 4 }, + { name: 'G22', rating: 4 }, + { name: 'G23', rating: 4 }, + { name: 'G24', rating: 4 }, + { name: 'G25', rating: 4 }, + { name: 'G26', rating: 4 }, + { name: 'G27', rating: 4 }, + { name: 'G28', rating: 4 }, + { name: 'G29', rating: 4 }, + { name: 'G30', rating: 4 }, + { name: 'G31', rating: 4 }, + { name: 'G32', rating: 4 }, + { name: 'G33', rating: 4 }, + { name: 'G34', rating: 4 }, + { name: 'G35', rating: 4 }, + { name: 'G36', rating: 4 }, + { name: 'G37', rating: 4 }, + { name: 'G38', rating: 4 }, + { name: 'G39', rating: 4 }, + { name: 'G40', rating: 4 }, + { name: 'G41', rating: 4 }, + { name: 'G42', rating: 4 }, + { name: 'G43', rating: 4 }, + { name: 'G44', rating: 4 }, + { name: 'G45', rating: 4 }, + { name: 'G46', rating: 4 }, + { name: 'H00', rating: 3 }, + { name: 'H01', rating: 3 }, + { name: 'H02', rating: 3 }, + { name: 'H03', rating: 3 }, + { name: 'H04', rating: 3 }, + { name: 'H05', rating: 3 }, + { name: 'H06', rating: 3 }, + { name: 'H07', rating: 3 }, + { name: 'H08', rating: 3 }, + { name: 'H09', rating: 3 }, + { name: 'H10', rating: 3 }, + { name: 'H11', rating: 3 }, + { name: 'H12', rating: 3 }, + { name: 'H13', rating: 3 }, + { name: 'H14', rating: 3 }, + { name: 'H15', rating: 3 }, + { name: 'H16', rating: 3 }, + { name: 'H17', rating: 3 }, + { name: 'H18', rating: 3 }, + { name: 'H19', rating: 3 }, + { name: 'H20', rating: 3 }, + { name: 'H21', rating: 3 }, + { name: 'H22', rating: 3 }, + { name: 'H23', rating: 3 }, + { name: 'H24', rating: 3 }, + { name: 'H25', rating: 3 }, + { name: 'H26', rating: 3 }, + { name: 'H27', rating: 3 }, + { name: 'H28', rating: 3 }, + { name: 'H29', rating: 3 }, + { name: 'H30', rating: 3 }, + { name: 'H31', rating: 3 }, + { name: 'H32', rating: 3 }, + { name: 'H33', rating: 3 }, + { name: 'H34', rating: 3 }, + { name: 'H35', rating: 3 }, + { name: 'H36', rating: 3 }, + { name: 'H37', rating: 3 }, + { name: 'H38', rating: 3 }, + { name: 'H39', rating: 3 }, + { name: 'H40', rating: 3 }, + { name: 'H41', rating: 3 }, + { name: 'H42', rating: 3 }, + { name: 'H43', rating: 3 }, + { name: 'H44', rating: 3 }, + { name: 'H45', rating: 3 }, + { name: 'H46', rating: 3 }, + { name: 'I00', rating: 2 }, + { name: 'I01', rating: 2 }, + { name: 'I02', rating: 2 }, + { name: 'I03', rating: 2 }, + { name: 'I04', rating: 2 }, + { name: 'I05', rating: 2 }, + { name: 'I06', rating: 2 }, + { name: 'I07', rating: 2 }, + { name: 'I08', rating: 2 }, + { name: 'I09', rating: 2 }, + { name: 'I10', rating: 2 }, + { name: 'I11', rating: 2 }, + { name: 'I12', rating: 2 }, + { name: 'I13', rating: 2 }, + { name: 'I14', rating: 2 }, + { name: 'I15', rating: 2 }, + { name: 'I16', rating: 2 }, + { name: 'I17', rating: 2 }, + { name: 'I18', rating: 2 }, + { name: 'I19', rating: 2 }, + { name: 'I20', rating: 2 }, + { name: 'I21', rating: 2 }, + { name: 'I22', rating: 2 }, + { name: 'I23', rating: 2 }, + { name: 'I24', rating: 2 }, + { name: 'I25', rating: 2 }, + { name: 'I26', rating: 2 }, + { name: 'I27', rating: 2 }, + { name: 'I28', rating: 2 }, + { name: 'I29', rating: 2 }, + { name: 'I30', rating: 2 }, + { name: 'I31', rating: 2 }, + { name: 'I32', rating: 2 }, + { name: 'I33', rating: 2 }, + { name: 'I34', rating: 2 }, + { name: 'I35', rating: 2 }, + { name: 'I36', rating: 2 }, + { name: 'I37', rating: 2 }, + { name: 'I38', rating: 2 }, + { name: 'I39', rating: 2 }, + { name: 'I40', rating: 2 }, + { name: 'I41', rating: 2 }, + { name: 'I42', rating: 2 }, + { name: 'I43', rating: 2 }, + { name: 'I44', rating: 2 }, + { name: 'I45', rating: 2 }, + { name: 'I46', rating: 2 }, + { name: 'J00', rating: 2 }, + { name: 'J01', rating: 2 }, + { name: 'J02', rating: 2 }, + { name: 'J03', rating: 2 }, + { name: 'J04', rating: 2 }, + { name: 'J05', rating: 2 }, + { name: 'J06', rating: 2 }, + { name: 'J07', rating: 2 }, + { name: 'J08', rating: 2 }, + { name: 'J09', rating: 2 }, + { name: 'J10', rating: 2 }, + { name: 'J11', rating: 2 }, + { name: 'J12', rating: 2 }, + { name: 'J13', rating: 2 }, + { name: 'J14', rating: 2 }, + { name: 'J15', rating: 2 }, + { name: 'J16', rating: 2 }, + { name: 'J17', rating: 2 }, + { name: 'J18', rating: 2 }, + { name: 'J19', rating: 2 }, + { name: 'J20', rating: 2 }, + { name: 'J21', rating: 2 }, + { name: 'J22', rating: 2 }, + { name: 'J23', rating: 2 }, + { name: 'J24', rating: 2 }, + { name: 'J25', rating: 2 }, + { name: 'J26', rating: 2 }, + { name: 'J27', rating: 2 }, + { name: 'J28', rating: 2 }, + { name: 'J29', rating: 2 }, + { name: 'J30', rating: 2 }, + { name: 'J31', rating: 2 }, + { name: 'J32', rating: 2 }, + { name: 'J33', rating: 2 }, + { name: 'J34', rating: 2 }, + { name: 'J35', rating: 2 }, + { name: 'J36', rating: 2 }, + { name: 'J37', rating: 2 }, + { name: 'J38', rating: 2 }, + { name: 'J39', rating: 2 }, + { name: 'J40', rating: 2 }, + { name: 'J41', rating: 2 }, + { name: 'J42', rating: 2 }, + { name: 'J43', rating: 2 }, + { name: 'J44', rating: 2 }, + { name: 'J45', rating: 2 }, + { name: 'J46', rating: 2 }, + { name: 'K00', rating: 2 }, + { name: 'K01', rating: 2 }, + { name: 'K02', rating: 2 }, + { name: 'K03', rating: 2 }, + { name: 'K04', rating: 2 }, + { name: 'K05', rating: 2 }, + { name: 'K06', rating: 2 }, + { name: 'K07', rating: 2 }, + { name: 'K08', rating: 2 }, + { name: 'K09', rating: 2 }, + { name: 'K10', rating: 2 }, + { name: 'K11', rating: 2 }, + { name: 'K12', rating: 2 }, + { name: 'K13', rating: 2 }, + { name: 'K14', rating: 2 }, + { name: 'K15', rating: 2 }, + { name: 'K16', rating: 2 }, + { name: 'K17', rating: 2 }, + { name: 'K18', rating: 2 }, + { name: 'K19', rating: 2 }, + { name: 'K20', rating: 2 }, + { name: 'K21', rating: 2 }, + { name: 'K22', rating: 2 }, + { name: 'K23', rating: 2 }, + { name: 'K24', rating: 2 }, + { name: 'K25', rating: 2 }, + { name: 'K26', rating: 2 }, + { name: 'K27', rating: 2 }, + { name: 'K28', rating: 2 }, + { name: 'K29', rating: 2 }, + { name: 'K30', rating: 2 }, + { name: 'K31', rating: 2 }, + { name: 'K32', rating: 2 }, + { name: 'K33', rating: 2 }, + { name: 'K34', rating: 2 }, + { name: 'K35', rating: 2 }, + { name: 'K36', rating: 2 }, + { name: 'K37', rating: 2 }, + { name: 'K38', rating: 2 }, + { name: 'K39', rating: 2 }, + { name: 'K40', rating: 2 }, + { name: 'K41', rating: 2 }, + { name: 'K42', rating: 2 }, +]; +assert.sameValue(array.length, 513); + +// Sort the elements by `rating` in descending order. +// (This updates `array` in place.) +array.sort((a, b) => b.rating - a.rating); + +const reduced = array.reduce((acc, element) => { + const letter = element.name.slice(0, 1); + const previousLetter = acc.slice(-1); + if (previousLetter === letter) { + return acc; + } + return acc + letter; +}, ''); +assert.sameValue(reduced, 'DGBEFHACIJK'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Atomics/notify/bigint/notify-all-on-loc.js b/js/src/tests/test262/built-ins/Atomics/notify/bigint/notify-all-on-loc.js index a02b557f3974..494899563447 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/bigint/notify-all-on-loc.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/bigint/notify-all-on-loc.js @@ -23,6 +23,10 @@ const BUFFER_SIZE = 4; // `Atomics.notify`. const TIMEOUT = $262.agent.timeouts.long; +const i64a = new BigInt64Array( + new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * BUFFER_SIZE) +); + for (var i = 0; i < NUMAGENT; i++) { $262.agent.start(` $262.agent.receiveBroadcast(function(sab) { @@ -54,11 +58,7 @@ $262.agent.start(` }); `); -const i64a = new BigInt64Array( - new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * BUFFER_SIZE) -); - -$262.agent.broadcast(i64a.buffer); +$262.agent.safeBroadcast(i64a); // Wait for agents to be running. $262.agent.waitUntil(i64a, RUNNING, BigInt(NUMAGENT + 1)); diff --git a/js/src/tests/test262/built-ins/Atomics/notify/count-defaults-to-infinity-missing.js b/js/src/tests/test262/built-ins/Atomics/notify/count-defaults-to-infinity-missing.js index 066403b869e4..10beac55cc00 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/count-defaults-to-infinity-missing.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/count-defaults-to-infinity-missing.js @@ -44,7 +44,7 @@ const i32a = new Int32Array( new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * BUFFER_SIZE) ); -$262.agent.broadcast(i32a.buffer); +$262.agent.safeBroadcast(i32a); $262.agent.waitUntil(i32a, RUNNING, NUMAGENT); // An agent may have been interrupted between reporting its initial report diff --git a/js/src/tests/test262/built-ins/Atomics/notify/count-defaults-to-infinity-undefined.js b/js/src/tests/test262/built-ins/Atomics/notify/count-defaults-to-infinity-undefined.js index 5f9eeac31707..66101c7944a0 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/count-defaults-to-infinity-undefined.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/count-defaults-to-infinity-undefined.js @@ -42,7 +42,7 @@ const i32a = new Int32Array( new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * BUFFER_SIZE) ); -$262.agent.broadcast(i32a.buffer); +$262.agent.safeBroadcast(i32a); $262.agent.waitUntil(i32a, RUNNING, NUMAGENT); // An agent may have been interrupted between reporting its initial report diff --git a/js/src/tests/test262/built-ins/Atomics/notify/negative-count.js b/js/src/tests/test262/built-ins/Atomics/notify/negative-count.js index 7f25b890a608..86a3e4561a02 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/negative-count.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/negative-count.js @@ -27,7 +27,7 @@ const i32a = new Int32Array( new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4) ); -$262.agent.broadcast(i32a.buffer); +$262.agent.safeBroadcast(i32a); $262.agent.waitUntil(i32a, RUNNING, 1); // Try to yield control to ensure the agent actually started to wait. diff --git a/js/src/tests/test262/built-ins/Atomics/notify/notify-all-on-loc.js b/js/src/tests/test262/built-ins/Atomics/notify/notify-all-on-loc.js index ade43c9f56ca..3796e8f4ba76 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/notify-all-on-loc.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/notify-all-on-loc.js @@ -58,7 +58,7 @@ const i32a = new Int32Array( new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * BUFFER_SIZE) ); -$262.agent.broadcast(i32a.buffer); +$262.agent.safeBroadcast(i32a); // Wait for agents to be running. $262.agent.waitUntil(i32a, RUNNING, NUMAGENT + 1); diff --git a/js/src/tests/test262/built-ins/Atomics/notify/notify-all.js b/js/src/tests/test262/built-ins/Atomics/notify/notify-all.js index 7fb8db7e9eb1..8fdd6fe4d3b5 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/notify-all.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/notify-all.js @@ -31,7 +31,7 @@ const i32a = new Int32Array( new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * BUFFER_SIZE) ); -$262.agent.broadcast(i32a.buffer); +$262.agent.safeBroadcast(i32a); // Wait for agents to be running. $262.agent.waitUntil(i32a, RUNNING, NUMAGENT); diff --git a/js/src/tests/test262/built-ins/Atomics/notify/notify-in-order-one-time.js b/js/src/tests/test262/built-ins/Atomics/notify/notify-in-order-one-time.js index 0a606c3d545e..0142fa61d0c3 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/notify-in-order-one-time.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/notify-in-order-one-time.js @@ -43,7 +43,7 @@ const i32a = new Int32Array( new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * BUFFER_SIZE) ); -$262.agent.broadcast(i32a.buffer); +$262.agent.safeBroadcast(i32a); // Wait for agents to be running. $262.agent.waitUntil(i32a, RUNNING, NUMAGENT); diff --git a/js/src/tests/test262/built-ins/Atomics/notify/notify-in-order.js b/js/src/tests/test262/built-ins/Atomics/notify/notify-in-order.js index 0a606c3d545e..0142fa61d0c3 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/notify-in-order.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/notify-in-order.js @@ -43,7 +43,7 @@ const i32a = new Int32Array( new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * BUFFER_SIZE) ); -$262.agent.broadcast(i32a.buffer); +$262.agent.safeBroadcast(i32a); // Wait for agents to be running. $262.agent.waitUntil(i32a, RUNNING, NUMAGENT); diff --git a/js/src/tests/test262/built-ins/Atomics/notify/notify-nan.js b/js/src/tests/test262/built-ins/Atomics/notify/notify-nan.js index a0cd8d3df1a1..da2be752476a 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/notify-nan.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/notify-nan.js @@ -27,7 +27,7 @@ const i32a = new Int32Array( new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4) ); -$262.agent.broadcast(i32a.buffer); +$262.agent.safeBroadcast(i32a); $262.agent.waitUntil(i32a, RUNNING, 1); // Try to yield control to ensure the agent actually started to wait. diff --git a/js/src/tests/test262/built-ins/Atomics/notify/notify-one.js b/js/src/tests/test262/built-ins/Atomics/notify/notify-one.js index 18c0f2c7b4ec..3799e9a1fe2e 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/notify-one.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/notify-one.js @@ -35,7 +35,7 @@ const i32a = new Int32Array( new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * BUFFER_SIZE) ); -$262.agent.broadcast(i32a.buffer); +$262.agent.safeBroadcast(i32a); // Wait for agents to be running. $262.agent.waitUntil(i32a, RUNNING, NUMAGENT); diff --git a/js/src/tests/test262/built-ins/Atomics/notify/notify-renotify-noop.js b/js/src/tests/test262/built-ins/Atomics/notify/notify-renotify-noop.js index d43b8e63e752..e1a88d2d5a67 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/notify-renotify-noop.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/notify-renotify-noop.js @@ -27,7 +27,7 @@ const i32a = new Int32Array( new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 2) ); -$262.agent.broadcast(i32a.buffer); +$262.agent.safeBroadcast(i32a); $262.agent.waitUntil(i32a, RUNNING, 1); diff --git a/js/src/tests/test262/built-ins/Atomics/notify/notify-two.js b/js/src/tests/test262/built-ins/Atomics/notify/notify-two.js index b702c9760d9a..886f054dfd94 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/notify-two.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/notify-two.js @@ -35,7 +35,7 @@ const i32a = new Int32Array( new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * BUFFER_SIZE) ); -$262.agent.broadcast(i32a.buffer); +$262.agent.safeBroadcast(i32a); // Wait for agents to be running. $262.agent.waitUntil(i32a, RUNNING, NUMAGENT); diff --git a/js/src/tests/test262/built-ins/Atomics/notify/notify-with-no-agents-waiting.js b/js/src/tests/test262/built-ins/Atomics/notify/notify-with-no-agents-waiting.js index 3f039c3d2adc..bc5c99dbf5f7 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/notify-with-no-agents-waiting.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/notify-with-no-agents-waiting.js @@ -25,7 +25,7 @@ const i32a = new Int32Array( new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 2) ); -$262.agent.broadcast(i32a.buffer); +$262.agent.safeBroadcast(i32a); $262.agent.waitUntil(i32a, RUNNING, 1); // There are ZERO agents waiting to notify... diff --git a/js/src/tests/test262/built-ins/Atomics/notify/notify-with-no-matching-agents-waiting.js b/js/src/tests/test262/built-ins/Atomics/notify/notify-with-no-matching-agents-waiting.js index 26ee2789de38..80d213ac9c51 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/notify-with-no-matching-agents-waiting.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/notify-with-no-matching-agents-waiting.js @@ -11,7 +11,7 @@ includes: [atomicsHelper.js] features: [Atomics, SharedArrayBuffer, TypedArray] ---*/ -const RUNNING = 1; +const RUNNING = 0; $262.agent.start(` $262.agent.receiveBroadcast(function(sab) { @@ -25,7 +25,7 @@ const i32a = new Int32Array( new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 2) ); -$262.agent.broadcast(i32a.buffer); +$262.agent.safeBroadcast(i32a); $262.agent.waitUntil(i32a, RUNNING, 1); // There are ZERO matching agents waiting on index 1 diff --git a/js/src/tests/test262/built-ins/Atomics/notify/notify-zero.js b/js/src/tests/test262/built-ins/Atomics/notify/notify-zero.js index ab830e03a687..dc0d07ffabf9 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/notify-zero.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/notify-zero.js @@ -35,7 +35,7 @@ const i32a = new Int32Array( new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * BUFFER_SIZE) ); -$262.agent.broadcast(i32a.buffer); +$262.agent.safeBroadcast(i32a); // Wait for agents to be running. $262.agent.waitUntil(i32a, RUNNING, NUMAGENT); diff --git a/js/src/tests/test262/built-ins/Atomics/notify/shell.js b/js/src/tests/test262/built-ins/Atomics/notify/shell.js index 8902d8b9fb92..7eae816bec7d 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/shell.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/shell.js @@ -29,6 +29,47 @@ description: > return r; }; } + +/** + * + * Share a given Int32Array or BigInt64Array to all running agents. Ensure that the + * provided TypedArray is a "shared typed array". + * + * NOTE: Migrating all tests to this API is necessary to prevent tests from hanging + * indefinitely when a SAB is sent to a worker but the code in the worker attempts to + * create a non-sharable TypedArray (something that is not Int32Array or BigInt64Array). + * When that scenario occurs, an exception is thrown and the agent worker can no + * longer communicate with any other threads that control the SAB. If the main + * thread happens to be spinning in the $262.agent.waitUntil() while loop, it will never + * meet its termination condition and the test will hang indefinitely. + * + * Because we've defined $262.agent.broadcast(SAB) in + * https://github.com/tc39/test262/blob/master/INTERPRETING.md, there are host implementations + * that assume compatibility, which must be maintained. + * + * + * $262.agent.safeBroadcast(TA) should not be included in + * https://github.com/tc39/test262/blob/master/INTERPRETING.md + * + * + * @param {(Int32Array|BigInt64Array)} typedArray An Int32Array or BigInt64Array with a SharedArrayBuffer + */ +$262.agent.safeBroadcast = function(typedArray) { + let Constructor = Object.getPrototypeOf(typedArray).constructor; + let temp = new Constructor( + new SharedArrayBuffer(Constructor.BYTES_PER_ELEMENT) + ); + try { + // This will never actually wait, but that's fine because we only + // want to ensure that this typedArray CAN be waited on and is shareable. + Atomics.wait(temp, 0, Constructor === Int32Array ? 1 : BigInt(1)); + } catch (error) { + $ERROR(`${Constructor.name} cannot be used as a shared typed array. (${error})`); + } + + $262.agent.broadcast(typedArray.buffer); +}; + /** * With a given Int32Array or BigInt64Array, wait until the expected number of agents have * reported themselves by calling: @@ -40,6 +81,7 @@ description: > * @param {number} expected The number of agents that are expected to report as active. */ $262.agent.waitUntil = function(typedArray, index, expected) { + var agents = 0; while ((agents = Atomics.load(typedArray, index)) !== expected) { /* nothing */ @@ -77,7 +119,7 @@ $262.agent.waitUntil = function(typedArray, index, expected) { * $262.agent.leaving(); * }); * `); - * $262.agent.broadcast(i32a.buffer); + * $262.agent.safeBroadcast(i32a.buffer); * * // Wait until the agent was started and then try to yield control to increase * // the likelihood the agent has called `Atomics.wait` and is now waiting. @@ -107,7 +149,7 @@ $262.agent.waitUntil = function(typedArray, index, expected) { * }); * `); * } - * $262.agent.broadcast(i32a.buffer); + * $262.agent.safeBroadcast(i32a.buffer); * * // Wait until the agents were started and then try to yield control to increase * // the likelihood the agents have called `Atomics.wait` and are now waiting. @@ -152,7 +194,7 @@ $262.agent.waitUntil = function(typedArray, index, expected) { * }); * `); * } - * $262.agent.broadcast(i32a.buffer); + * $262.agent.safeBroadcast(i32a.buffer); * * // Wait until the agents were started and then try to yield control to increase * // the likelihood the agents have called `Atomics.wait` and are now waiting. @@ -205,7 +247,7 @@ $262.agent.timeouts = { * $262.agent.leaving(); * }); * `); - * $262.agent.broadcast(i32a.buffer); + * $262.agent.safeBroadcast(i32a.buffer); * * // Wait until agent was started and then try to yield control. * $262.agent.waitUntil(i32a, RUNNING, 1); diff --git a/js/src/tests/test262/built-ins/Atomics/notify/undefined-index-defaults-to-zero.js b/js/src/tests/test262/built-ins/Atomics/notify/undefined-index-defaults-to-zero.js index c18fa58608d6..d621db1ff63e 100644 --- a/js/src/tests/test262/built-ins/Atomics/notify/undefined-index-defaults-to-zero.js +++ b/js/src/tests/test262/built-ins/Atomics/notify/undefined-index-defaults-to-zero.js @@ -51,7 +51,7 @@ const i32a = new Int32Array( new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4) ); -$262.agent.broadcast(i32a.buffer); +$262.agent.safeBroadcast(i32a); // Wait until both agents started. $262.agent.waitUntil(i32a, RUNNING, NUMAGENT); diff --git a/js/src/tests/test262/built-ins/Atomics/wait/bigint/false-for-timeout-agent.js b/js/src/tests/test262/built-ins/Atomics/wait/bigint/false-for-timeout-agent.js index 1e0b82346373..27f592439e3e 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/bigint/false-for-timeout-agent.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/bigint/false-for-timeout-agent.js @@ -17,6 +17,10 @@ includes: [atomicsHelper.js] features: [Atomics, BigInt, SharedArrayBuffer, TypedArray] ---*/ +const i64a = new BigInt64Array( + new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 4) +); + const RUNNING = 1; $262.agent.start(` @@ -47,11 +51,7 @@ $262.agent.start(` }); `); -const i64a = new BigInt64Array( - new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 4) -); - -$262.agent.broadcast(i64a.buffer); +$262.agent.safeBroadcast(i64a); $262.agent.waitUntil(i64a, RUNNING, 1n); // Try to yield control to ensure the agent actually started to wait. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/bigint/nan-for-timeout.js b/js/src/tests/test262/built-ins/Atomics/wait/bigint/nan-for-timeout.js index 79aa1c499135..270d2d176ef6 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/bigint/nan-for-timeout.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/bigint/nan-for-timeout.js @@ -18,6 +18,10 @@ includes: [atomicsHelper.js] features: [Atomics, BigInt, SharedArrayBuffer, TypedArray] ---*/ +const i64a = new BigInt64Array( + new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 4) +); + const RUNNING = 1; $262.agent.start(` @@ -30,11 +34,7 @@ $262.agent.start(` }); `); -const i64a = new BigInt64Array( - new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 4) -); - -$262.agent.broadcast(i64a.buffer); +$262.agent.safeBroadcast(i64a); $262.agent.waitUntil(i64a, RUNNING, 1n); // Try to yield control to ensure the agent actually started to wait. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/bigint/negative-timeout-agent.js b/js/src/tests/test262/built-ins/Atomics/wait/bigint/negative-timeout-agent.js index eac0733647c2..af379d679f69 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/bigint/negative-timeout-agent.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/bigint/negative-timeout-agent.js @@ -10,6 +10,10 @@ includes: [atomicsHelper.js] features: [Atomics, BigInt, SharedArrayBuffer, TypedArray] ---*/ +const i64a = new BigInt64Array( + new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 4) +); + const RUNNING = 1; $262.agent.start(` @@ -22,11 +26,7 @@ $262.agent.start(` }); `); -const i64a = new BigInt64Array( - new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 4) -); - -$262.agent.broadcast(i64a.buffer); +$262.agent.safeBroadcast(i64a); $262.agent.waitUntil(i64a, RUNNING, 1n); // Try to yield control to ensure the agent actually started to wait. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-no-operation.js b/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-no-operation.js index 6db581f19d2c..94182b6e1790 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-no-operation.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-no-operation.js @@ -39,7 +39,7 @@ $262.agent.start(` }); `); -$262.agent.broadcast(i64a.buffer); +$262.agent.safeBroadcast(i64a); $262.agent.waitUntil(i64a, RUNNING, 1n); // Try to yield control to ensure the agent actually started to wait. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-add.js b/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-add.js index f8fd154731df..cf53ace6c2a1 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-add.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-add.js @@ -32,7 +32,7 @@ $262.agent.start(` }); `); -$262.agent.broadcast(i64a.buffer); +$262.agent.safeBroadcast(i64a); $262.agent.waitUntil(i64a, RUNNING, 1n); // Try to yield control to ensure the agent actually started to wait. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-and.js b/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-and.js index c8a9f253c1f5..28a27872bf42 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-and.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-and.js @@ -32,7 +32,7 @@ $262.agent.start(` }); `); -$262.agent.broadcast(i64a.buffer); +$262.agent.safeBroadcast(i64a); $262.agent.waitUntil(i64a, RUNNING, 1n); // Try to yield control to ensure the agent actually started to wait. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-compareExchange.js b/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-compareExchange.js index 205b4818dfdf..8c59d02bad62 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-compareExchange.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-compareExchange.js @@ -32,7 +32,7 @@ $262.agent.start(` }); `); -$262.agent.broadcast(i64a.buffer); +$262.agent.safeBroadcast(i64a); $262.agent.waitUntil(i64a, RUNNING, 1n); // Try to yield control to ensure the agent actually started to wait. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-exchange.js b/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-exchange.js index 0c128f8d9799..7f112f451945 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-exchange.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-exchange.js @@ -32,7 +32,7 @@ $262.agent.start(` }); `); -$262.agent.broadcast(i64a.buffer); +$262.agent.safeBroadcast(i64a); $262.agent.waitUntil(i64a, RUNNING, 1n); // Try to yield control to ensure the agent actually started to wait. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-or.js b/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-or.js index a1206dec0258..7eb13ad71b9c 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-or.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-or.js @@ -32,7 +32,7 @@ $262.agent.start(` }); `); -$262.agent.broadcast(i64a.buffer); +$262.agent.safeBroadcast(i64a); $262.agent.waitUntil(i64a, RUNNING, 1n); // Try to yield control to ensure the agent actually started to wait. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-store.js b/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-store.js index 1aeeecb811f9..ce3b4f421ed3 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-store.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-store.js @@ -32,7 +32,7 @@ $262.agent.start(` }); `); -$262.agent.broadcast(i64a.buffer); +$262.agent.safeBroadcast(i64a); $262.agent.waitUntil(i64a, RUNNING, 1n); // Try to yield control to ensure the agent actually started to wait. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-sub.js b/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-sub.js index c7a15bf4407b..7917f7afd4a1 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-sub.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-sub.js @@ -32,7 +32,7 @@ $262.agent.start(` }); `); -$262.agent.broadcast(i64a.buffer); +$262.agent.safeBroadcast(i64a); $262.agent.waitUntil(i64a, RUNNING, 1n); // Try to yield control to ensure the agent actually started to wait. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-xor.js b/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-xor.js index 42aaca1f0a4c..9dd441396d39 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-xor.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/bigint/no-spurious-wakeup-on-xor.js @@ -32,7 +32,7 @@ $262.agent.start(` }); `); -$262.agent.broadcast(i64a.buffer); +$262.agent.safeBroadcast(i64a); $262.agent.waitUntil(i64a, RUNNING, 1n); // Try to yield control to ensure the agent actually started to wait. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/bigint/value-not-equal.js b/js/src/tests/test262/built-ins/Atomics/wait/bigint/value-not-equal.js index c0db3a141f78..9b6e92f029c1 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/bigint/value-not-equal.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/bigint/value-not-equal.js @@ -20,9 +20,12 @@ features: [Atomics, BigInt, SharedArrayBuffer, TypedArray] ---*/ const RUNNING = 1; - const value = "42n"; +const i64a = new BigInt64Array( + new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 4) +); + $262.agent.start(` $262.agent.receiveBroadcast(function(sab) { const i64a = new BigInt64Array(sab); @@ -34,15 +37,11 @@ $262.agent.start(` }); `); -const i64a = new BigInt64Array( - new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 4) -); - // NB: We don't actually explicitly need to wait for the agent to start in this // test case, we only do it for consistency with other test cases which do // require the main agent to wait and yield control. -$262.agent.broadcast(i64a.buffer); +$262.agent.safeBroadcast(i64a); $262.agent.waitUntil(i64a, RUNNING, 1n); // Try to yield control to ensure the agent actually started to wait. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/bigint/waiterlist-block-indexedposition-wake.js b/js/src/tests/test262/built-ins/Atomics/wait/bigint/waiterlist-block-indexedposition-wake.js index faeb1356135d..e42a4ff36204 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/bigint/waiterlist-block-indexedposition-wake.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/bigint/waiterlist-block-indexedposition-wake.js @@ -26,6 +26,10 @@ features: [Atomics, BigInt, SharedArrayBuffer, TypedArray] var NUMAGENT = 2; var RUNNING = 4; +const i64a = new BigInt64Array( + new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 5) +); + $262.agent.start(` $262.agent.receiveBroadcast(function(sab) { const i64a = new BigInt64Array(sab); @@ -48,11 +52,7 @@ $262.agent.start(` }); `); -const i64a = new BigInt64Array( - new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 5) -); - -$262.agent.broadcast(i64a.buffer); +$262.agent.safeBroadcast(i64a); // Wait until all agents started. $262.agent.waitUntil(i64a, RUNNING, BigInt(NUMAGENT)); diff --git a/js/src/tests/test262/built-ins/Atomics/wait/bigint/waiterlist-order-of-operations-is-fifo.js b/js/src/tests/test262/built-ins/Atomics/wait/bigint/waiterlist-order-of-operations-is-fifo.js index 88269e53cb55..3ba8d4ada02c 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/bigint/waiterlist-order-of-operations-is-fifo.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/bigint/waiterlist-order-of-operations-is-fifo.js @@ -17,11 +17,14 @@ includes: [atomicsHelper.js] features: [Atomics, BigInt, SharedArrayBuffer, TypedArray] ---*/ -var NUMAGENT = 3; - var WAIT_INDEX = 0; var RUNNING = 1; var LOCK_INDEX = 2; +var NUMAGENT = 3; + +const i64a = new BigInt64Array( + new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 4) +); for (var i = 0; i < NUMAGENT; i++) { var agentNum = i; @@ -51,11 +54,7 @@ for (var i = 0; i < NUMAGENT; i++) { `); } -const i64a = new BigInt64Array( - new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 4) -); - -$262.agent.broadcast(i64a.buffer); +$262.agent.safeBroadcast(i64a); // Wait until all agents started. $262.agent.waitUntil(i64a, RUNNING, BigInt(NUMAGENT)); diff --git a/js/src/tests/test262/built-ins/Atomics/wait/bigint/was-woken-before-timeout.js b/js/src/tests/test262/built-ins/Atomics/wait/bigint/was-woken-before-timeout.js index 2aff07620c8c..fa1418f5012a 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/bigint/was-woken-before-timeout.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/bigint/was-woken-before-timeout.js @@ -26,6 +26,10 @@ features: [Atomics, BigInt, SharedArrayBuffer, TypedArray] const RUNNING = 1; const TIMEOUT = $262.agent.timeouts.huge; +const i64a = new BigInt64Array( + new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 4) +); + $262.agent.start(` $262.agent.receiveBroadcast(function(sab) { const i64a = new BigInt64Array(sab); @@ -41,11 +45,7 @@ $262.agent.start(` }); `); -const i64a = new BigInt64Array( - new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 4) -); - -$262.agent.broadcast(i64a.buffer); +$262.agent.safeBroadcast(i64a); $262.agent.waitUntil(i64a, RUNNING, 1n); // Try to yield control to ensure the agent actually started to wait. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/false-for-timeout-agent.js b/js/src/tests/test262/built-ins/Atomics/wait/false-for-timeout-agent.js index 4d82b79c9213..90af603a5b62 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/false-for-timeout-agent.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/false-for-timeout-agent.js @@ -51,7 +51,7 @@ const i32a = new Int32Array( new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4) ); -$262.agent.broadcast(i32a.buffer); +$262.agent.safeBroadcast(i32a); $262.agent.waitUntil(i32a, RUNNING, 1); // Try to yield control to ensure the agent actually started to wait. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/nan-for-timeout.js b/js/src/tests/test262/built-ins/Atomics/wait/nan-for-timeout.js index b808f1ec624d..006cc204b09a 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/nan-for-timeout.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/nan-for-timeout.js @@ -34,7 +34,7 @@ const i32a = new Int32Array( new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4) ); -$262.agent.broadcast(i32a.buffer); +$262.agent.safeBroadcast(i32a); $262.agent.waitUntil(i32a, RUNNING, 1); // Try to yield control to ensure the agent actually started to wait. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/negative-timeout-agent.js b/js/src/tests/test262/built-ins/Atomics/wait/negative-timeout-agent.js index fc25de6cde41..9dc10cb5e5a1 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/negative-timeout-agent.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/negative-timeout-agent.js @@ -26,7 +26,7 @@ const i32a = new Int32Array( new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4) ); -$262.agent.broadcast(i32a.buffer); +$262.agent.safeBroadcast(i32a); $262.agent.waitUntil(i32a, RUNNING, 1); // Try to yield control to ensure the agent actually started to wait. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-no-operation.js b/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-no-operation.js index 8db49c8850d5..e6769b8bab4a 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-no-operation.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-no-operation.js @@ -39,7 +39,7 @@ $262.agent.start(` }); `); -$262.agent.broadcast(i32a.buffer); +$262.agent.safeBroadcast(i32a); $262.agent.waitUntil(i32a, RUNNING, 1); // Try to yield control to ensure the agent actually started to wait. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-add.js b/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-add.js index 9918b3acd13d..bc2df97dceda 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-add.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-add.js @@ -32,7 +32,7 @@ $262.agent.start(` }); `); -$262.agent.broadcast(i32a.buffer); +$262.agent.safeBroadcast(i32a); $262.agent.waitUntil(i32a, RUNNING, 1); // Try to yield control to ensure the agent actually started to wait. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-and.js b/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-and.js index 9da14c2d0cbc..884325894922 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-and.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-and.js @@ -32,7 +32,7 @@ $262.agent.start(` }); `); -$262.agent.broadcast(i32a.buffer); +$262.agent.safeBroadcast(i32a); $262.agent.waitUntil(i32a, RUNNING, 1); // Try to yield control to ensure the agent actually started to wait. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-compareExchange.js b/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-compareExchange.js index 3dfbf5bf411c..3fe8530ee8ce 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-compareExchange.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-compareExchange.js @@ -32,7 +32,7 @@ $262.agent.start(` }); `); -$262.agent.broadcast(i32a.buffer); +$262.agent.safeBroadcast(i32a); $262.agent.waitUntil(i32a, RUNNING, 1); // Try to yield control to ensure the agent actually started to wait. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-exchange.js b/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-exchange.js index 8c6f6922e38d..7417f05f46a8 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-exchange.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-exchange.js @@ -32,7 +32,7 @@ $262.agent.start(` }); `); -$262.agent.broadcast(i32a.buffer); +$262.agent.safeBroadcast(i32a); $262.agent.waitUntil(i32a, RUNNING, 1); // Try to yield control to ensure the agent actually started to wait. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-or.js b/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-or.js index 16f14953c00f..2a4c5438773b 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-or.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-or.js @@ -32,7 +32,7 @@ $262.agent.start(` }); `); -$262.agent.broadcast(i32a.buffer); +$262.agent.safeBroadcast(i32a); $262.agent.waitUntil(i32a, RUNNING, 1); // Try to yield control to ensure the agent actually started to wait. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-store.js b/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-store.js index 42b4d75a21b9..75b8a7aa7e60 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-store.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-store.js @@ -32,7 +32,7 @@ $262.agent.start(` }); `); -$262.agent.broadcast(i32a.buffer); +$262.agent.safeBroadcast(i32a); $262.agent.waitUntil(i32a, RUNNING, 1); // Try to yield control to ensure the agent actually started to wait. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-sub.js b/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-sub.js index 30bd1a8386e1..4a5c7625a896 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-sub.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-sub.js @@ -32,7 +32,7 @@ $262.agent.start(` }); `); -$262.agent.broadcast(i32a.buffer); +$262.agent.safeBroadcast(i32a); $262.agent.waitUntil(i32a, RUNNING, 1); // Try to yield control to ensure the agent actually started to wait. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-xor.js b/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-xor.js index 42d52c99e67c..45757a0c9d63 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-xor.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/no-spurious-wakeup-on-xor.js @@ -32,7 +32,7 @@ $262.agent.start(` }); `); -$262.agent.broadcast(i32a.buffer); +$262.agent.safeBroadcast(i32a); $262.agent.waitUntil(i32a, RUNNING, 1); // Try to yield control to ensure the agent actually started to wait. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/null-for-timeout-agent.js b/js/src/tests/test262/built-ins/Atomics/wait/null-for-timeout-agent.js index 71ce335070a6..6cd222ace2c8 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/null-for-timeout-agent.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/null-for-timeout-agent.js @@ -51,7 +51,7 @@ const i32a = new Int32Array( new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4) ); -$262.agent.broadcast(i32a.buffer); +$262.agent.safeBroadcast(i32a); $262.agent.waitUntil(i32a, RUNNING, 1); // Try to yield control to ensure the agent actually started to wait. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/object-for-timeout-agent.js b/js/src/tests/test262/built-ins/Atomics/wait/object-for-timeout-agent.js index 403a001d6692..112435bd060b 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/object-for-timeout-agent.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/object-for-timeout-agent.js @@ -57,7 +57,7 @@ const i32a = new Int32Array( new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4) ); -$262.agent.broadcast(i32a.buffer); +$262.agent.safeBroadcast(i32a); $262.agent.waitUntil(i32a, RUNNING, 1); // Try to yield control to ensure the agent actually started to wait. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/poisoned-object-for-timeout-throws-agent.js b/js/src/tests/test262/built-ins/Atomics/wait/poisoned-object-for-timeout-throws-agent.js index e5e4cd4228c4..099e4f7ecfae 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/poisoned-object-for-timeout-throws-agent.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/poisoned-object-for-timeout-throws-agent.js @@ -60,7 +60,7 @@ const i32a = new Int32Array( new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4) ); -$262.agent.broadcast(i32a.buffer); +$262.agent.safeBroadcast(i32a); $262.agent.waitUntil(i32a, RUNNING, 1); // Try to yield control to ensure the agent actually started to wait. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/shell.js b/js/src/tests/test262/built-ins/Atomics/wait/shell.js index 7c66943af0f2..9a507888982f 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/shell.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/shell.js @@ -29,6 +29,47 @@ description: > return r; }; } + +/** + * + * Share a given Int32Array or BigInt64Array to all running agents. Ensure that the + * provided TypedArray is a "shared typed array". + * + * NOTE: Migrating all tests to this API is necessary to prevent tests from hanging + * indefinitely when a SAB is sent to a worker but the code in the worker attempts to + * create a non-sharable TypedArray (something that is not Int32Array or BigInt64Array). + * When that scenario occurs, an exception is thrown and the agent worker can no + * longer communicate with any other threads that control the SAB. If the main + * thread happens to be spinning in the $262.agent.waitUntil() while loop, it will never + * meet its termination condition and the test will hang indefinitely. + * + * Because we've defined $262.agent.broadcast(SAB) in + * https://github.com/tc39/test262/blob/master/INTERPRETING.md, there are host implementations + * that assume compatibility, which must be maintained. + * + * + * $262.agent.safeBroadcast(TA) should not be included in + * https://github.com/tc39/test262/blob/master/INTERPRETING.md + * + * + * @param {(Int32Array|BigInt64Array)} typedArray An Int32Array or BigInt64Array with a SharedArrayBuffer + */ +$262.agent.safeBroadcast = function(typedArray) { + let Constructor = Object.getPrototypeOf(typedArray).constructor; + let temp = new Constructor( + new SharedArrayBuffer(Constructor.BYTES_PER_ELEMENT) + ); + try { + // This will never actually wait, but that's fine because we only + // want to ensure that this typedArray CAN be waited on and is shareable. + Atomics.wait(temp, 0, Constructor === Int32Array ? 1 : BigInt(1)); + } catch (error) { + $ERROR(`${Constructor.name} cannot be used as a shared typed array. (${error})`); + } + + $262.agent.broadcast(typedArray.buffer); +}; + /** * With a given Int32Array or BigInt64Array, wait until the expected number of agents have * reported themselves by calling: @@ -40,6 +81,7 @@ description: > * @param {number} expected The number of agents that are expected to report as active. */ $262.agent.waitUntil = function(typedArray, index, expected) { + var agents = 0; while ((agents = Atomics.load(typedArray, index)) !== expected) { /* nothing */ @@ -77,7 +119,7 @@ $262.agent.waitUntil = function(typedArray, index, expected) { * $262.agent.leaving(); * }); * `); - * $262.agent.broadcast(i32a.buffer); + * $262.agent.safeBroadcast(i32a.buffer); * * // Wait until the agent was started and then try to yield control to increase * // the likelihood the agent has called `Atomics.wait` and is now waiting. @@ -107,7 +149,7 @@ $262.agent.waitUntil = function(typedArray, index, expected) { * }); * `); * } - * $262.agent.broadcast(i32a.buffer); + * $262.agent.safeBroadcast(i32a.buffer); * * // Wait until the agents were started and then try to yield control to increase * // the likelihood the agents have called `Atomics.wait` and are now waiting. @@ -152,7 +194,7 @@ $262.agent.waitUntil = function(typedArray, index, expected) { * }); * `); * } - * $262.agent.broadcast(i32a.buffer); + * $262.agent.safeBroadcast(i32a.buffer); * * // Wait until the agents were started and then try to yield control to increase * // the likelihood the agents have called `Atomics.wait` and are now waiting. @@ -205,7 +247,7 @@ $262.agent.timeouts = { * $262.agent.leaving(); * }); * `); - * $262.agent.broadcast(i32a.buffer); + * $262.agent.safeBroadcast(i32a.buffer); * * // Wait until agent was started and then try to yield control. * $262.agent.waitUntil(i32a, RUNNING, 1); diff --git a/js/src/tests/test262/built-ins/Atomics/wait/symbol-for-index-throws-agent.js b/js/src/tests/test262/built-ins/Atomics/wait/symbol-for-index-throws-agent.js index b318797e19a5..354739517947 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/symbol-for-index-throws-agent.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/symbol-for-index-throws-agent.js @@ -73,7 +73,7 @@ const i32a = new Int32Array( new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4) ); -$262.agent.broadcast(i32a.buffer); +$262.agent.safeBroadcast(i32a); $262.agent.waitUntil(i32a, RUNNING, 1); // Try to yield control to ensure the agent actually started to wait. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/symbol-for-timeout-throws-agent.js b/js/src/tests/test262/built-ins/Atomics/wait/symbol-for-timeout-throws-agent.js index e24f6ec8c49b..599b3fb45319 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/symbol-for-timeout-throws-agent.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/symbol-for-timeout-throws-agent.js @@ -48,7 +48,7 @@ const i32a = new Int32Array( new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4) ); -$262.agent.broadcast(i32a.buffer); +$262.agent.safeBroadcast(i32a); $262.agent.waitUntil(i32a, RUNNING, 1); // Try to yield control to ensure the agent actually started to wait. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/symbol-for-value-throws-agent.js b/js/src/tests/test262/built-ins/Atomics/wait/symbol-for-value-throws-agent.js index d89936d26d45..6f6c00b05176 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/symbol-for-value-throws-agent.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/symbol-for-value-throws-agent.js @@ -64,7 +64,7 @@ const i32a = new Int32Array( new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4) ); -$262.agent.broadcast(i32a.buffer); +$262.agent.safeBroadcast(i32a); $262.agent.waitUntil(i32a, RUNNING, 1); // Try to yield control to ensure the agent actually started to wait. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/true-for-timeout-agent.js b/js/src/tests/test262/built-ins/Atomics/wait/true-for-timeout-agent.js index 9236b2d7760d..bdc7e519b9a1 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/true-for-timeout-agent.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/true-for-timeout-agent.js @@ -51,7 +51,7 @@ const i32a = new Int32Array( new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4) ); -$262.agent.broadcast(i32a.buffer); +$262.agent.safeBroadcast(i32a); $262.agent.waitUntil(i32a, RUNNING, 1); // Try to yield control to ensure the agent actually started to wait. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/undefined-for-timeout.js b/js/src/tests/test262/built-ins/Atomics/wait/undefined-for-timeout.js index d87af74bb71d..fe3e7bbefe3b 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/undefined-for-timeout.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/undefined-for-timeout.js @@ -49,7 +49,7 @@ const i32a = new Int32Array( new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4) ); -$262.agent.broadcast(i32a.buffer); +$262.agent.safeBroadcast(i32a); $262.agent.waitUntil(i32a, RUNNING, NUMAGENT); // Try to yield control to ensure the agent actually started to wait. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/undefined-index-defaults-to-zero.js b/js/src/tests/test262/built-ins/Atomics/wait/undefined-index-defaults-to-zero.js index 88e730fef9cf..dc999cfa31ac 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/undefined-index-defaults-to-zero.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/undefined-index-defaults-to-zero.js @@ -40,7 +40,7 @@ const i32a = new Int32Array( new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4) ); -$262.agent.broadcast(i32a.buffer); +$262.agent.safeBroadcast(i32a); $262.agent.waitUntil(i32a, RUNNING, 1); // Try to yield control to ensure the agent actually started to wait. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/value-not-equal.js b/js/src/tests/test262/built-ins/Atomics/wait/value-not-equal.js index 356d4576d473..9ac7d8cb06ff 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/value-not-equal.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/value-not-equal.js @@ -42,7 +42,7 @@ const i32a = new Int32Array( // test case, we only do it for consistency with other test cases which do // require the main agent to wait and yield control. -$262.agent.broadcast(i32a.buffer); +$262.agent.safeBroadcast(i32a); $262.agent.waitUntil(i32a, RUNNING, 1); // Try to yield control to ensure the agent actually started to wait. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/wait-index-value-not-equal.js b/js/src/tests/test262/built-ins/Atomics/wait/wait-index-value-not-equal.js index 860684aee598..bcf4d64e7442 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/wait-index-value-not-equal.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/wait-index-value-not-equal.js @@ -39,7 +39,7 @@ const i32a = new Int32Array( // test case, we only do it for consistency with other test cases which do // require the main agent to wait and yield control. -$262.agent.broadcast(i32a.buffer); +$262.agent.safeBroadcast(i32a); $262.agent.waitUntil(i32a, RUNNING, 1); // Try to yield control to ensure the agent actually started to wait. diff --git a/js/src/tests/test262/built-ins/Atomics/wait/waiterlist-block-indexedposition-wake.js b/js/src/tests/test262/built-ins/Atomics/wait/waiterlist-block-indexedposition-wake.js index ede60705af08..119636483dc7 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/waiterlist-block-indexedposition-wake.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/waiterlist-block-indexedposition-wake.js @@ -52,7 +52,7 @@ const i32a = new Int32Array( new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 5) ); -$262.agent.broadcast(i32a.buffer); +$262.agent.safeBroadcast(i32a); // Wait until all agents started. $262.agent.waitUntil(i32a, RUNNING, NUMAGENT); diff --git a/js/src/tests/test262/built-ins/Atomics/wait/waiterlist-order-of-operations-is-fifo.js b/js/src/tests/test262/built-ins/Atomics/wait/waiterlist-order-of-operations-is-fifo.js index 870cbabab6e4..930df10ab2f5 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/waiterlist-order-of-operations-is-fifo.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/waiterlist-order-of-operations-is-fifo.js @@ -55,7 +55,7 @@ const i32a = new Int32Array( new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4) ); -$262.agent.broadcast(i32a.buffer); +$262.agent.safeBroadcast(i32a); // Wait until all agents started. $262.agent.waitUntil(i32a, RUNNING, NUMAGENT); diff --git a/js/src/tests/test262/built-ins/Atomics/wait/was-woken-before-timeout.js b/js/src/tests/test262/built-ins/Atomics/wait/was-woken-before-timeout.js index 5246230551d9..4c209cd66419 100644 --- a/js/src/tests/test262/built-ins/Atomics/wait/was-woken-before-timeout.js +++ b/js/src/tests/test262/built-ins/Atomics/wait/was-woken-before-timeout.js @@ -45,7 +45,7 @@ const i32a = new Int32Array( new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4) ); -$262.agent.broadcast(i32a.buffer); +$262.agent.safeBroadcast(i32a); $262.agent.waitUntil(i32a, RUNNING, 1); // Try to yield control to ensure the agent actually started to wait. diff --git a/js/src/tests/test262/built-ins/BigInt/asIntN/bigint-tobigint-errors.js b/js/src/tests/test262/built-ins/BigInt/asIntN/bigint-tobigint-errors.js index 0fb330a5eaa8..024c1a91db47 100644 --- a/js/src/tests/test262/built-ins/BigInt/asIntN/bigint-tobigint-errors.js +++ b/js/src/tests/test262/built-ins/BigInt/asIntN/bigint-tobigint-errors.js @@ -10,7 +10,8 @@ info: | 2. Let bigint ? ToBigInt(bigint). features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive] ---*/ - +assert.sameValue(typeof BigInt, 'function'); +assert.sameValue(typeof BigInt.asIntN, 'function'); assert.throws(TypeError, function() { BigInt.asIntN(0, undefined); }, "ToBigInt: undefined => TypeError"); diff --git a/js/src/tests/test262/built-ins/BigInt/asIntN/bigint-tobigint-toprimitive.js b/js/src/tests/test262/built-ins/BigInt/asIntN/bigint-tobigint-toprimitive.js index 6b3f35a888c7..735f9f3b40b8 100644 --- a/js/src/tests/test262/built-ins/BigInt/asIntN/bigint-tobigint-toprimitive.js +++ b/js/src/tests/test262/built-ins/BigInt/asIntN/bigint-tobigint-toprimitive.js @@ -10,7 +10,8 @@ info: | 2. Let bigint ? ToBigInt(bigint). features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive] ---*/ - +assert.sameValue(typeof BigInt, 'function'); +assert.sameValue(typeof BigInt.asIntN, 'function'); function err() { throw new Test262Error(); } diff --git a/js/src/tests/test262/built-ins/BigInt/asIntN/bits-toindex-errors.js b/js/src/tests/test262/built-ins/BigInt/asIntN/bits-toindex-errors.js index e96407dab4fb..60d3c35685df 100644 --- a/js/src/tests/test262/built-ins/BigInt/asIntN/bits-toindex-errors.js +++ b/js/src/tests/test262/built-ins/BigInt/asIntN/bits-toindex-errors.js @@ -10,6 +10,8 @@ info: | 1. Let bits be ? ToIndex(bits). features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive] ---*/ +assert.sameValue(typeof BigInt, 'function'); +assert.sameValue(typeof BigInt.asIntN, 'function'); assert.throws(RangeError, function() { BigInt.asIntN(-1, 0n); diff --git a/js/src/tests/test262/built-ins/BigInt/asIntN/bits-toindex-toprimitive.js b/js/src/tests/test262/built-ins/BigInt/asIntN/bits-toindex-toprimitive.js index 9727896e5ba7..79e20e0bd58b 100644 --- a/js/src/tests/test262/built-ins/BigInt/asIntN/bits-toindex-toprimitive.js +++ b/js/src/tests/test262/built-ins/BigInt/asIntN/bits-toindex-toprimitive.js @@ -10,6 +10,8 @@ info: | 1. Let bits be ? ToIndex(bits). features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive] ---*/ +assert.sameValue(typeof BigInt, 'function'); +assert.sameValue(typeof BigInt.asIntN, 'function'); function err() { throw new Test262Error(); diff --git a/js/src/tests/test262/built-ins/BigInt/asUintN/bigint-tobigint-errors.js b/js/src/tests/test262/built-ins/BigInt/asUintN/bigint-tobigint-errors.js index da7d607c83e3..8866dbc291da 100644 --- a/js/src/tests/test262/built-ins/BigInt/asUintN/bigint-tobigint-errors.js +++ b/js/src/tests/test262/built-ins/BigInt/asUintN/bigint-tobigint-errors.js @@ -10,6 +10,8 @@ info: | 2. Let bigint ? ToBigInt(bigint). features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive] ---*/ +assert.sameValue(typeof BigInt, 'function'); +assert.sameValue(typeof BigInt.asUintN, 'function'); assert.throws(TypeError, function() { BigInt.asUintN(0, undefined); diff --git a/js/src/tests/test262/built-ins/BigInt/asUintN/bigint-tobigint-toprimitive.js b/js/src/tests/test262/built-ins/BigInt/asUintN/bigint-tobigint-toprimitive.js index 9c205eca14e5..b192abfe8399 100644 --- a/js/src/tests/test262/built-ins/BigInt/asUintN/bigint-tobigint-toprimitive.js +++ b/js/src/tests/test262/built-ins/BigInt/asUintN/bigint-tobigint-toprimitive.js @@ -10,6 +10,8 @@ info: | 2. Let bigint ? ToBigInt(bigint). features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive] ---*/ +assert.sameValue(typeof BigInt, 'function'); +assert.sameValue(typeof BigInt.asUintN, 'function'); function err() { throw new Test262Error(); diff --git a/js/src/tests/test262/built-ins/BigInt/asUintN/bits-toindex-errors.js b/js/src/tests/test262/built-ins/BigInt/asUintN/bits-toindex-errors.js index 9084a90b3938..08aa0e7a950b 100644 --- a/js/src/tests/test262/built-ins/BigInt/asUintN/bits-toindex-errors.js +++ b/js/src/tests/test262/built-ins/BigInt/asUintN/bits-toindex-errors.js @@ -10,6 +10,8 @@ info: | 1. Let bits be ? ToIndex(bits). features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive] ---*/ +assert.sameValue(typeof BigInt, 'function'); +assert.sameValue(typeof BigInt.asUintN, 'function'); assert.throws(RangeError, function() { BigInt.asUintN(-1, 0n); diff --git a/js/src/tests/test262/built-ins/BigInt/asUintN/bits-toindex-toprimitive.js b/js/src/tests/test262/built-ins/BigInt/asUintN/bits-toindex-toprimitive.js index dd66e01c83eb..89e7359de390 100644 --- a/js/src/tests/test262/built-ins/BigInt/asUintN/bits-toindex-toprimitive.js +++ b/js/src/tests/test262/built-ins/BigInt/asUintN/bits-toindex-toprimitive.js @@ -10,6 +10,8 @@ info: | 1. Let bits be ? ToIndex(bits). features: [BigInt, computed-property-names, Symbol, Symbol.toPrimitive] ---*/ +assert.sameValue(typeof BigInt, 'function'); +assert.sameValue(typeof BigInt.asUintN, 'function'); function err() { throw new Test262Error(); diff --git a/js/src/tests/test262/built-ins/BigInt/new-target-throws.js b/js/src/tests/test262/built-ins/BigInt/new-target-throws.js index a17b8a81fd60..f58ac29364fb 100644 --- a/js/src/tests/test262/built-ins/BigInt/new-target-throws.js +++ b/js/src/tests/test262/built-ins/BigInt/new-target-throws.js @@ -10,6 +10,7 @@ info: | ... features: [BigInt] ---*/ +assert.sameValue(typeof BigInt, 'function'); assert.throws(TypeError, function() { new BigInt(); diff --git a/js/src/tests/test262/built-ins/BigInt/prototype/toString/prototype-call.js b/js/src/tests/test262/built-ins/BigInt/prototype/toString/prototype-call.js index ff6a23d5be2c..d2d79cd835d0 100644 --- a/js/src/tests/test262/built-ins/BigInt/prototype/toString/prototype-call.js +++ b/js/src/tests/test262/built-ins/BigInt/prototype/toString/prototype-call.js @@ -16,6 +16,7 @@ info: | [[BigIntData]] internal slot. features: [BigInt] ---*/ +assert.sameValue(typeof BigInt, 'function'); assert.throws(TypeError, function() { BigInt.prototype.toString(1); diff --git a/js/src/tests/test262/built-ins/BigInt/prototype/toString/thisbigintvalue-not-valid-throws.js b/js/src/tests/test262/built-ins/BigInt/prototype/toString/thisbigintvalue-not-valid-throws.js index b37b5e69ad65..271970ad8bfc 100644 --- a/js/src/tests/test262/built-ins/BigInt/prototype/toString/thisbigintvalue-not-valid-throws.js +++ b/js/src/tests/test262/built-ins/BigInt/prototype/toString/thisbigintvalue-not-valid-throws.js @@ -22,6 +22,8 @@ features: [BigInt, Symbol, Symbol.toPrimitive] var toString = BigInt.prototype.toString; +assert.sameValue(typeof toString, 'function'); + assert.throws(TypeError, function() { toString.call({ x: 1n diff --git a/js/src/tests/test262/built-ins/BigInt/prototype/valueOf/this-value-invalid-object-throws.js b/js/src/tests/test262/built-ins/BigInt/prototype/valueOf/this-value-invalid-object-throws.js index abcafe46c394..acd3a2c0ad7c 100644 --- a/js/src/tests/test262/built-ins/BigInt/prototype/valueOf/this-value-invalid-object-throws.js +++ b/js/src/tests/test262/built-ins/BigInt/prototype/valueOf/this-value-invalid-object-throws.js @@ -21,6 +21,7 @@ features: [BigInt] ---*/ var valueOf = BigInt.prototype.valueOf; +assert.sameValue(typeof valueOf, 'function'); assert.throws(TypeError, function() { valueOf.call({}); diff --git a/js/src/tests/test262/built-ins/BigInt/prototype/valueOf/this-value-invalid-primitive-throws.js b/js/src/tests/test262/built-ins/BigInt/prototype/valueOf/this-value-invalid-primitive-throws.js index d91f74882e55..3753fee00662 100644 --- a/js/src/tests/test262/built-ins/BigInt/prototype/valueOf/this-value-invalid-primitive-throws.js +++ b/js/src/tests/test262/built-ins/BigInt/prototype/valueOf/this-value-invalid-primitive-throws.js @@ -22,6 +22,8 @@ features: [BigInt, Symbol] var valueOf = BigInt.prototype.valueOf; +assert.sameValue(typeof valueOf, 'function'); + assert.throws(TypeError, function() { valueOf.call(undefined); }, "undefined"); diff --git a/js/src/tests/test262/built-ins/Object/fromEntries/iterator-closed-for-null-entry.js b/js/src/tests/test262/built-ins/Object/fromEntries/iterator-closed-for-null-entry.js index 3f3f72624b56..96afcb373504 100644 --- a/js/src/tests/test262/built-ins/Object/fromEntries/iterator-closed-for-null-entry.js +++ b/js/src/tests/test262/built-ins/Object/fromEntries/iterator-closed-for-null-entry.js @@ -49,6 +49,7 @@ var iterable = { }, }; +assert.sameValue(typeof Object.fromEntries, 'function'); assert.throws(TypeError, function() { Object.fromEntries(iterable); }); diff --git a/js/src/tests/test262/built-ins/Object/fromEntries/iterator-closed-for-string-entry.js b/js/src/tests/test262/built-ins/Object/fromEntries/iterator-closed-for-string-entry.js index 615261dbb38d..4f9639ac4aee 100644 --- a/js/src/tests/test262/built-ins/Object/fromEntries/iterator-closed-for-string-entry.js +++ b/js/src/tests/test262/built-ins/Object/fromEntries/iterator-closed-for-string-entry.js @@ -49,6 +49,7 @@ var iterable = { }, }; +assert.sameValue(typeof Object.fromEntries, 'function'); assert.throws(TypeError, function() { Object.fromEntries(iterable); }); diff --git a/js/src/tests/test262/built-ins/Object/fromEntries/iterator-not-closed-for-next-returning-non-object.js b/js/src/tests/test262/built-ins/Object/fromEntries/iterator-not-closed-for-next-returning-non-object.js index 077e5ec08ae5..e4d37f5190ff 100644 --- a/js/src/tests/test262/built-ins/Object/fromEntries/iterator-not-closed-for-next-returning-non-object.js +++ b/js/src/tests/test262/built-ins/Object/fromEntries/iterator-not-closed-for-next-returning-non-object.js @@ -45,6 +45,7 @@ var iterable = { }, }; +assert.sameValue(typeof Object.fromEntries, 'function'); assert.throws(TypeError, function() { Object.fromEntries(iterable); }); diff --git a/js/src/tests/test262/built-ins/Object/fromEntries/iterator-not-closed-for-uncallable-next.js b/js/src/tests/test262/built-ins/Object/fromEntries/iterator-not-closed-for-uncallable-next.js index 766a7b1b5d2a..2d13a95735a1 100644 --- a/js/src/tests/test262/built-ins/Object/fromEntries/iterator-not-closed-for-uncallable-next.js +++ b/js/src/tests/test262/built-ins/Object/fromEntries/iterator-not-closed-for-uncallable-next.js @@ -36,6 +36,7 @@ var iterable = { }, }; +assert.sameValue(typeof Object.fromEntries, 'function'); assert.throws(TypeError, function() { Object.fromEntries(iterable); }); diff --git a/js/src/tests/test262/built-ins/Object/fromEntries/requires-argument.js b/js/src/tests/test262/built-ins/Object/fromEntries/requires-argument.js index 139182046a45..b4a529a8ee29 100644 --- a/js/src/tests/test262/built-ins/Object/fromEntries/requires-argument.js +++ b/js/src/tests/test262/built-ins/Object/fromEntries/requires-argument.js @@ -14,6 +14,7 @@ info: | features: [Object.fromEntries] ---*/ +assert.sameValue(typeof Object.fromEntries, 'function'); assert.throws(TypeError, function() { Object.fromEntries(); }); diff --git a/js/src/tests/test262/built-ins/Object/fromEntries/string-entry-primitive-throws.js b/js/src/tests/test262/built-ins/Object/fromEntries/string-entry-primitive-throws.js index 68198d39ccd5..3bb99993638d 100644 --- a/js/src/tests/test262/built-ins/Object/fromEntries/string-entry-primitive-throws.js +++ b/js/src/tests/test262/built-ins/Object/fromEntries/string-entry-primitive-throws.js @@ -7,6 +7,7 @@ esid: sec-object.fromentries features: [Object.fromEntries] ---*/ +assert.sameValue(typeof Object.fromEntries, 'function'); assert.throws(TypeError, function() { Object.fromEntries(['ab']); }); diff --git a/js/src/tests/test262/built-ins/Promise/prototype/finally/this-value-non-object.js b/js/src/tests/test262/built-ins/Promise/prototype/finally/this-value-non-object.js index dd3ec2c1271b..8c9ec2e7bdd3 100644 --- a/js/src/tests/test262/built-ins/Promise/prototype/finally/this-value-non-object.js +++ b/js/src/tests/test262/built-ins/Promise/prototype/finally/this-value-non-object.js @@ -8,6 +8,8 @@ esid: sec-promise.prototype.finally features: [Promise.prototype.finally] ---*/ +assert.sameValue(typeof Promise.prototype.finally, 'function'); + assert.throws(TypeError, function() { Promise.prototype.finally.call(undefined); }, 'undefined'); diff --git a/js/src/tests/test262/built-ins/Promise/prototype/finally/this-value-then-not-callable.js b/js/src/tests/test262/built-ins/Promise/prototype/finally/this-value-then-not-callable.js index a4b56a09bd67..ad5c687d6b8c 100644 --- a/js/src/tests/test262/built-ins/Promise/prototype/finally/this-value-then-not-callable.js +++ b/js/src/tests/test262/built-ins/Promise/prototype/finally/this-value-then-not-callable.js @@ -8,6 +8,7 @@ description: > esid: sec-promise.prototype.finally features: [Symbol, Promise.prototype.finally] ---*/ +assert.sameValue(typeof Promise.prototype.finally, 'function'); var symbol = Symbol(); diff --git a/js/src/tests/test262/built-ins/Proxy/getOwnPropertyDescriptor/call-parameters.js b/js/src/tests/test262/built-ins/Proxy/getOwnPropertyDescriptor/call-parameters.js index 85a21ac43676..e2de3003d0bc 100644 --- a/js/src/tests/test262/built-ins/Proxy/getOwnPropertyDescriptor/call-parameters.js +++ b/js/src/tests/test262/built-ins/Proxy/getOwnPropertyDescriptor/call-parameters.js @@ -23,7 +23,7 @@ var handler = { _handler = this; _prop = prop; - return Object.getOwnPropertyDescriptor(t); + return Object.getOwnPropertyDescriptor(t, prop); } }; var p = new Proxy(target, handler); diff --git a/js/src/tests/test262/built-ins/Proxy/getOwnPropertyDescriptor/result-type-is-not-object-nor-undefined.js b/js/src/tests/test262/built-ins/Proxy/getOwnPropertyDescriptor/result-type-is-not-object-nor-undefined.js index 38289538f27f..5d93892e5f08 100644 --- a/js/src/tests/test262/built-ins/Proxy/getOwnPropertyDescriptor/result-type-is-not-object-nor-undefined.js +++ b/js/src/tests/test262/built-ins/Proxy/getOwnPropertyDescriptor/result-type-is-not-object-nor-undefined.js @@ -18,8 +18,7 @@ var target = { number: 1, symbol: Symbol(), string: '', - boolean: true, - fn: function() {} + boolean: true }; var p = new Proxy(target, { getOwnPropertyDescriptor: function(t, prop) { @@ -43,8 +42,4 @@ assert.throws(TypeError, function() { Object.getOwnPropertyDescriptor(p, "boolean"); }); -assert.throws(TypeError, function() { - Object.getOwnPropertyDescriptor(p, "fn"); -}); - reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Reflect/ownKeys/return-on-corresponding-order-large-index.js b/js/src/tests/test262/built-ins/Reflect/ownKeys/return-on-corresponding-order-large-index.js index 6b39d68ea285..70ea65de92f6 100644 --- a/js/src/tests/test262/built-ins/Reflect/ownKeys/return-on-corresponding-order-large-index.js +++ b/js/src/tests/test262/built-ins/Reflect/ownKeys/return-on-corresponding-order-large-index.js @@ -15,10 +15,10 @@ info: | 9.1.12 [[OwnPropertyKeys]] ( ) 1. Let keys be a new empty List. - 2. For each own property key P of O that is an integer index, in ascending + 2. For each own property key P of O that is an array index, in ascending numeric index order a. Add P as the last element of keys. - 3. For each own property key P of O that is a String but is not an integer + 3. For each own property key P of O that is a String but is not an array index, in property creation order a. Add P as the last element of keys. 4. For each own property key P of O that is a Symbol, in property creation @@ -36,18 +36,22 @@ var o1 = { [Number.MAX_SAFE_INTEGER]: true, [Symbol.for('z')]: true, 12345678901: true, + 4294967294: true, + 4294967295: true, }; var result = Reflect.ownKeys(o1); -assert.sameValue(result.length, 7); +assert.sameValue(result.length, 9); assert.sameValue(result[0], '1'); -assert.sameValue(result[1], '12345678900'); -assert.sameValue(result[2], '12345678901'); -assert.sameValue(result[3], String(Number.MAX_SAFE_INTEGER)); -assert.sameValue(result[4], 'b'); -assert.sameValue(result[5], 'a'); -assert.sameValue(result[6], Symbol.for('z')); +assert.sameValue(result[1], '4294967294'); +assert.sameValue(result[2], '12345678900'); +assert.sameValue(result[3], 'b'); +assert.sameValue(result[4], 'a'); +assert.sameValue(result[5], String(Number.MAX_SAFE_INTEGER)); +assert.sameValue(result[6], '12345678901'); +assert.sameValue(result[7], '4294967295'); +assert.sameValue(result[8], Symbol.for('z')); var o2 = {}; @@ -58,17 +62,21 @@ o2.a = true; o2[Number.MAX_SAFE_INTEGER] = true; o2[Symbol.for('z')] = true; o2[12345678901] = true; +o2[4294967294] = true; +o2[4294967295] = true; result = Reflect.ownKeys(o2); -assert.sameValue(result.length, 7); +assert.sameValue(result.length, 9); assert.sameValue(result[0], '1'); -assert.sameValue(result[1], '12345678900'); -assert.sameValue(result[2], '12345678901'); -assert.sameValue(result[3], String(Number.MAX_SAFE_INTEGER)); -assert.sameValue(result[4], 'b'); -assert.sameValue(result[5], 'a'); -assert.sameValue(result[6], Symbol.for('z')); +assert.sameValue(result[1], '4294967294'); +assert.sameValue(result[2], '12345678900'); +assert.sameValue(result[3], 'b'); +assert.sameValue(result[4], 'a'); +assert.sameValue(result[5], String(Number.MAX_SAFE_INTEGER)); +assert.sameValue(result[6], '12345678901'); +assert.sameValue(result[7], '4294967295'); +assert.sameValue(result[8], Symbol.for('z')); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Set/prototype/add/does-not-have-setdata-internal-slot-weakset.js b/js/src/tests/test262/built-ins/Set/prototype/add/does-not-have-setdata-internal-slot-weakset.js index 9737de0edbea..a618778d6198 100644 --- a/js/src/tests/test262/built-ins/Set/prototype/add/does-not-have-setdata-internal-slot-weakset.js +++ b/js/src/tests/test262/built-ins/Set/prototype/add/does-not-have-setdata-internal-slot-weakset.js @@ -8,7 +8,7 @@ description: > ... 3. If S does not have a [[SetData]] internal slot, throw a TypeError exception. ... - +features: [WeakSet] ---*/ assert.throws(TypeError, function() { diff --git a/js/src/tests/test262/built-ins/Set/prototype/clear/does-not-have-setdata-internal-slot-weakset.js b/js/src/tests/test262/built-ins/Set/prototype/clear/does-not-have-setdata-internal-slot-weakset.js index 2449ab461da6..2544e4188d0a 100644 --- a/js/src/tests/test262/built-ins/Set/prototype/clear/does-not-have-setdata-internal-slot-weakset.js +++ b/js/src/tests/test262/built-ins/Set/prototype/clear/does-not-have-setdata-internal-slot-weakset.js @@ -8,7 +8,7 @@ description: > ... 3. If S does not have a [[SetData]] internal slot, throw a TypeError exception. ... - +features: [WeakSet] ---*/ assert.throws(TypeError, function() { diff --git a/js/src/tests/test262/built-ins/Set/prototype/delete/does-not-have-setdata-internal-slot-weakset.js b/js/src/tests/test262/built-ins/Set/prototype/delete/does-not-have-setdata-internal-slot-weakset.js index 5187286b0bc2..ba38153667bf 100644 --- a/js/src/tests/test262/built-ins/Set/prototype/delete/does-not-have-setdata-internal-slot-weakset.js +++ b/js/src/tests/test262/built-ins/Set/prototype/delete/does-not-have-setdata-internal-slot-weakset.js @@ -8,7 +8,7 @@ description: > ... 3. If S does not have a [[SetData]] internal slot, throw a TypeError exception. ... - +features: [WeakSet] ---*/ assert.throws(TypeError, function() { diff --git a/js/src/tests/test262/built-ins/Set/prototype/entries/does-not-have-setdata-internal-slot-weakset.js b/js/src/tests/test262/built-ins/Set/prototype/entries/does-not-have-setdata-internal-slot-weakset.js index 6a27ca00f104..53f11499e7ce 100644 --- a/js/src/tests/test262/built-ins/Set/prototype/entries/does-not-have-setdata-internal-slot-weakset.js +++ b/js/src/tests/test262/built-ins/Set/prototype/entries/does-not-have-setdata-internal-slot-weakset.js @@ -14,6 +14,7 @@ description: > ... 2. If S does not have a [[SetData]] internal slot, throw a TypeError exception. ... +features: [WeakSet] ---*/ assert.throws(TypeError, function() { diff --git a/js/src/tests/test262/built-ins/Set/prototype/forEach/does-not-have-setdata-internal-slot-weakset.js b/js/src/tests/test262/built-ins/Set/prototype/forEach/does-not-have-setdata-internal-slot-weakset.js index 0f0fe747f7c7..e4d452f2de00 100644 --- a/js/src/tests/test262/built-ins/Set/prototype/forEach/does-not-have-setdata-internal-slot-weakset.js +++ b/js/src/tests/test262/built-ins/Set/prototype/forEach/does-not-have-setdata-internal-slot-weakset.js @@ -8,7 +8,7 @@ description: > ... 3. If S does not have a [[SetData]] internal slot, throw a TypeError exception. ... - +features: [WeakSet] ---*/ assert.throws(TypeError, function() { diff --git a/js/src/tests/test262/built-ins/Set/prototype/has/does-not-have-setdata-internal-slot-weakset.js b/js/src/tests/test262/built-ins/Set/prototype/has/does-not-have-setdata-internal-slot-weakset.js index f0b3a70159df..cdb2d2c45122 100644 --- a/js/src/tests/test262/built-ins/Set/prototype/has/does-not-have-setdata-internal-slot-weakset.js +++ b/js/src/tests/test262/built-ins/Set/prototype/has/does-not-have-setdata-internal-slot-weakset.js @@ -8,7 +8,7 @@ description: > ... 3. If S does not have a [[SetData]] internal slot, throw a TypeError exception. ... - +features: [WeakSet] ---*/ assert.throws(TypeError, function() { diff --git a/js/src/tests/test262/built-ins/Set/prototype/values/does-not-have-setdata-internal-slot-weakset.js b/js/src/tests/test262/built-ins/Set/prototype/values/does-not-have-setdata-internal-slot-weakset.js index 7132197e8a9a..bbdb416f3f05 100644 --- a/js/src/tests/test262/built-ins/Set/prototype/values/does-not-have-setdata-internal-slot-weakset.js +++ b/js/src/tests/test262/built-ins/Set/prototype/values/does-not-have-setdata-internal-slot-weakset.js @@ -14,6 +14,7 @@ description: > ... 2. If S does not have a [[SetData]] internal slot, throw a TypeError exception. ... +features: [WeakSet] ---*/ assert.throws(TypeError, function() { diff --git a/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-is-null.js b/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-is-null.js index 04ac626be966..0fad2753ca91 100644 --- a/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-is-null.js +++ b/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-is-null.js @@ -9,14 +9,9 @@ info: | 1. Let O be ? RequireObjectCoercible(this value). 2. If regexp is neither undefined nor null, then [...] - 3. Return ? MatchAllIterator(regexp, O). - - MatchAllIterator( regexp, O ) - [...] - 2. If ? IsRegExp(regexp) is true, then - [...] - 3. Else, - a. Let R be RegExpCreate(regexp, "g"). + 3. Let S be ? ToString(O). + 4. Let rx be ? RegExpCreate(R, "g"). + 5. Return ? Invoke(rx, @@matchAll, « S »). features: [String.prototype.matchAll] includes: [compareArray.js, compareIterator.js, regExpUtils.js] ---*/ diff --git a/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-is-undefined-or-null-invokes-matchAll.js b/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-is-undefined-or-null-invokes-matchAll.js new file mode 100644 index 000000000000..6544550fd1b5 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-is-undefined-or-null-invokes-matchAll.js @@ -0,0 +1,33 @@ +// |reftest| skip -- String.prototype.matchAll is not supported +// Copyright (C) 2018 Peter Wong. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: pending +description: Behavior when regexp is null or undefined +info: | + String.prototype.matchAll ( regexp ) + 1. Let O be ? RequireObjectCoercible(this value). + 2. If regexp is neither undefined nor null, then + [...] + 3. Let S be ? ToString(O). + 4. Let rx be ? RegExpCreate(R, "g"). + 5. Return ? Invoke(rx, @@matchAll, « S »). +features: [String.prototype.matchAll] +includes: [compareArray.js, compareIterator.js, regExpUtils.js] +---*/ + +var callCount = 0; +var obj = {}; +RegExp.prototype[Symbol.matchAll] = function() { + callCount++; + return obj; +}; + +assert.sameValue('a'.matchAll(null), obj); +assert.sameValue(callCount, 1); + +assert.sameValue(''.matchAll(undefined), obj); +assert.sameValue(callCount, 2); + + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-matchAll-is-undefined-or-null.js b/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-matchAll-is-undefined-or-null.js new file mode 100644 index 000000000000..d0c1ea5435a8 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-matchAll-is-undefined-or-null.js @@ -0,0 +1,41 @@ +// |reftest| skip -- Symbol.matchAll,String.prototype.matchAll is not supported +// Copyright (C) 2018 Peter Wong. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: pending +description: Behavior when regexp[@@matchAll] is undefined or null +info: | + String.prototype.matchAll ( regexp ) + 1. Let O be ? RequireObjectCoercible(this value). + 2. If regexp is neither undefined nor null, then + a. Let matcher be ? GetMethod(regexp, @@matchAll). + b. If matcher is not undefined, then + [...] + 3. Let S be ? ToString(O). + 4. Let rx be ? RegExpCreate(R, "g"). + 5. Return ? Invoke(rx, @@matchAll, « S »). +features: [Symbol.matchAll, String.prototype.matchAll] +---*/ + +var regexp = /./; +var callCount = 0; +var arg; +var obj = {}; +var str = 'abc'; +RegExp.prototype[Symbol.matchAll] = function(string) { + arg = string; + callCount++; + return obj; +}; + +regexp[Symbol.matchAll] = undefined; +assert.sameValue(str.matchAll(regexp), obj); +assert.sameValue(arg, str); +assert.sameValue(callCount, 1); + +regexp[Symbol.matchAll] = null; +assert.sameValue(str.matchAll(regexp), obj); +assert.sameValue(arg, str); +assert.sameValue(callCount, 2); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-matchAll-not-callable.js b/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-matchAll-not-callable.js new file mode 100644 index 000000000000..cc374b844081 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-matchAll-not-callable.js @@ -0,0 +1,37 @@ +// |reftest| skip -- Symbol.matchAll,String.prototype.matchAll is not supported +// Copyright (C) 2018 Peter Wong. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: pending +description: Behavior when regexp[@@matchAll] is not callable +info: | + String.prototype.matchAll ( regexp ) + [...] + 2. If regexp is neither undefined nor null, then + a. Let matcher be ? GetMethod(regexp, @@matchAll). +features: [Symbol.matchAll, String.prototype.matchAll] +---*/ + +var regexp = /./; + +regexp[Symbol.matchAll] = true; +assert.throws(TypeError, function() { + ''.matchAll(regexp); +}); + +regexp[Symbol.matchAll] = 5; +assert.throws(TypeError, function() { + ''.matchAll(regexp); +}); + +regexp[Symbol.matchAll] = ''; +assert.throws(TypeError, function() { + ''.matchAll(regexp); +}); + +regexp[Symbol.matchAll] = Symbol(); +assert.throws(TypeError, function() { + ''.matchAll(regexp); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-prototype-has-no-matchAll.js b/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-prototype-has-no-matchAll.js index e37e0f3199bc..98f0fc95eeb0 100644 --- a/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-prototype-has-no-matchAll.js +++ b/js/src/tests/test262/built-ins/String/prototype/matchAll/regexp-prototype-has-no-matchAll.js @@ -12,17 +12,9 @@ info: | b. If matcher is not undefined, then [...] [...] - 4. Let matcher be ? RegExpCreate(R, "g"). - [...] + 4. Let rx be ? RegExpCreate(R, "g"). + 5. Return ? Invoke(rx, @@matchAll, « S »). - 21.2.3.2.3 Runtime Semantics: RegExpCreate ( P, F ) - [...] - 2. Return ? RegExpInitialize(obj, P, F). - - 21.2.3.2.2 Runtime Semantics: RegExpInitialize ( obj, pattern, flags ) - 1. If pattern is undefined, let P be the empty String. - 2. Else, let P be ? ToString(pattern). - [...] features: [Symbol.matchAll, String.prototype.matchAll] includes: [compareArray.js, compareIterator.js, regExpUtils.js] ---*/ @@ -30,9 +22,8 @@ includes: [compareArray.js, compareIterator.js, regExpUtils.js] delete RegExp.prototype[Symbol.matchAll]; var str = '/a/g*/b/g'; -assert.compareIterator(str.matchAll(/\w/g), [ - matchValidator(['/a/g'], 0, str), - matchValidator(['/b/g'], 5, str) -]); +assert.throws(TypeError, function() { + str.matchAll(/\w/g); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/matchAll/toString-this-val.js b/js/src/tests/test262/built-ins/String/prototype/matchAll/toString-this-val.js new file mode 100644 index 000000000000..ee5a383f5b20 --- /dev/null +++ b/js/src/tests/test262/built-ins/String/prototype/matchAll/toString-this-val.js @@ -0,0 +1,44 @@ +// |reftest| skip -- Symbol.matchAll,String.prototype.matchAll is not supported +// Copyright (C) 2018 Peter Wong. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: pending +description: | + Verify ToString is called when regexp[@@matchAll] is undefined or null +info: | + String.prototype.matchAll ( regexp ) + 1. Let O be ? RequireObjectCoercible(this value). + 2. If regexp is neither undefined nor null, then + a. Let matcher be ? GetMethod(regexp, @@matchAll). + b. If matcher is not undefined, then + [...] + 3. Let S be ? ToString(O). + 4. Let rx be ? RegExpCreate(R, "g"). + 5. Return ? Invoke(rx, @@matchAll, « S »). +features: [Symbol.matchAll, String.prototype.matchAll] +---*/ + +var regexp = /./; +var callCount = 0; +var arg; +var obj = {}; +var toStringResult = 'abc'; +var receiver = { + [Symbol.toPrimitive]: function() { + callCount++; + return toStringResult; + } +}; +RegExp.prototype[Symbol.matchAll] = function(string) { + arg = string; +}; + +String.prototype.matchAll.call(receiver, null); +assert.sameValue(callCount, 1); +assert.sameValue(arg, toStringResult); + +String.prototype.matchAll.call(receiver, undefined); +assert.sameValue(callCount, 2); +assert.sameValue(arg, toStringResult); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/String/prototype/trimEnd/this-value-object-toprimitive-returns-object-err.js b/js/src/tests/test262/built-ins/String/prototype/trimEnd/this-value-object-toprimitive-returns-object-err.js index 423be8298586..7405357aec8d 100644 --- a/js/src/tests/test262/built-ins/String/prototype/trimEnd/this-value-object-toprimitive-returns-object-err.js +++ b/js/src/tests/test262/built-ins/String/prototype/trimEnd/this-value-object-toprimitive-returns-object-err.js @@ -33,6 +33,7 @@ var thisVal = { }, }; +assert.sameValue(typeof String.prototype.trimEnd, 'function'); assert.throws(TypeError, function() { String.prototype.trimEnd.call(thisVal); }); diff --git a/js/src/tests/test262/built-ins/String/prototype/trimEnd/this-value-object-tostring-returns-object-err.js b/js/src/tests/test262/built-ins/String/prototype/trimEnd/this-value-object-tostring-returns-object-err.js index 83d461d68fe1..1acf34e68db2 100644 --- a/js/src/tests/test262/built-ins/String/prototype/trimEnd/this-value-object-tostring-returns-object-err.js +++ b/js/src/tests/test262/built-ins/String/prototype/trimEnd/this-value-object-tostring-returns-object-err.js @@ -51,6 +51,7 @@ var thisVal = { }, }; +assert.sameValue(typeof String.prototype.trimEnd, 'function'); assert.throws(TypeError, function() { String.prototype.trimEnd.call(thisVal); }); diff --git a/js/src/tests/test262/built-ins/String/prototype/trimEnd/this-value-object-valueof-returns-object-err.js b/js/src/tests/test262/built-ins/String/prototype/trimEnd/this-value-object-valueof-returns-object-err.js index c21793e2eb1f..00e4041850e7 100644 --- a/js/src/tests/test262/built-ins/String/prototype/trimEnd/this-value-object-valueof-returns-object-err.js +++ b/js/src/tests/test262/built-ins/String/prototype/trimEnd/this-value-object-valueof-returns-object-err.js @@ -52,6 +52,7 @@ var thisVal = { }, }; +assert.sameValue(typeof String.prototype.trimEnd, 'function'); assert.throws(TypeError, function() { String.prototype.trimEnd.call(thisVal); }); diff --git a/js/src/tests/test262/built-ins/String/prototype/trimStart/this-value-object-toprimitive-returns-object-err.js b/js/src/tests/test262/built-ins/String/prototype/trimStart/this-value-object-toprimitive-returns-object-err.js index dac5aa172bbb..383aab41f43c 100644 --- a/js/src/tests/test262/built-ins/String/prototype/trimStart/this-value-object-toprimitive-returns-object-err.js +++ b/js/src/tests/test262/built-ins/String/prototype/trimStart/this-value-object-toprimitive-returns-object-err.js @@ -33,6 +33,7 @@ var thisVal = { }, }; +assert.sameValue(typeof String.prototype.trimStart, 'function'); assert.throws(TypeError, function() { String.prototype.trimStart.call(thisVal); }); diff --git a/js/src/tests/test262/built-ins/String/prototype/trimStart/this-value-object-tostring-returns-object-err.js b/js/src/tests/test262/built-ins/String/prototype/trimStart/this-value-object-tostring-returns-object-err.js index d8223cde4af3..82c9165a5220 100644 --- a/js/src/tests/test262/built-ins/String/prototype/trimStart/this-value-object-tostring-returns-object-err.js +++ b/js/src/tests/test262/built-ins/String/prototype/trimStart/this-value-object-tostring-returns-object-err.js @@ -51,6 +51,7 @@ var thisVal = { }, }; +assert.sameValue(typeof String.prototype.trimStart, 'function'); assert.throws(TypeError, function() { String.prototype.trimStart.call(thisVal); }); diff --git a/js/src/tests/test262/built-ins/String/prototype/trimStart/this-value-object-valueof-returns-object-err.js b/js/src/tests/test262/built-ins/String/prototype/trimStart/this-value-object-valueof-returns-object-err.js index 48fb0c0270d9..9205faaddc03 100644 --- a/js/src/tests/test262/built-ins/String/prototype/trimStart/this-value-object-valueof-returns-object-err.js +++ b/js/src/tests/test262/built-ins/String/prototype/trimStart/this-value-object-valueof-returns-object-err.js @@ -52,6 +52,7 @@ var thisVal = { }, }; +assert.sameValue(typeof String.prototype.trimStart, 'function'); assert.throws(TypeError, function() { String.prototype.trimStart.call(thisVal); }); diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/BigInt64Array/prototype/not-typedarray-object.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/BigInt64Array/prototype/not-typedarray-object.js index 65bc68a8973c..50ff3c11b449 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/BigInt64Array/prototype/not-typedarray-object.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/BigInt64Array/prototype/not-typedarray-object.js @@ -13,7 +13,7 @@ info: | are specific to TypedArray instance objects. features: [BigInt] ---*/ - +assert.sameValue(typeof BigInt64Array, 'function'); assert.throws(TypeError, function () { BigInt64Array.prototype.buffer; }); diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/BigUint64Array/prototype/not-typedarray-object.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/BigUint64Array/prototype/not-typedarray-object.js index 3c9cac852108..58e67d5f795c 100644 --- a/js/src/tests/test262/built-ins/TypedArrayConstructors/BigUint64Array/prototype/not-typedarray-object.js +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/BigUint64Array/prototype/not-typedarray-object.js @@ -13,7 +13,7 @@ info: | are specific to TypedArray instance objects. features: [BigInt] ---*/ - +assert.sameValue(typeof BigUint64Array, 'function'); assert.throws(TypeError, function () { BigUint64Array.prototype.buffer; }); diff --git a/js/src/tests/test262/intl402/ListFormat/constructor/constructor/locales-invalid.js b/js/src/tests/test262/intl402/ListFormat/constructor/constructor/locales-invalid.js index f6845966a38c..949337cb4366 100644 --- a/js/src/tests/test262/intl402/ListFormat/constructor/constructor/locales-invalid.js +++ b/js/src/tests/test262/intl402/ListFormat/constructor/constructor/locales-invalid.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/constructor/constructor/locales-valid.js b/js/src/tests/test262/intl402/ListFormat/constructor/constructor/locales-valid.js index f89443ec98ce..af7b58e9af91 100644 --- a/js/src/tests/test262/intl402/ListFormat/constructor/constructor/locales-valid.js +++ b/js/src/tests/test262/intl402/ListFormat/constructor/constructor/locales-valid.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/constructor/constructor/newtarget-undefined.js b/js/src/tests/test262/intl402/ListFormat/constructor/constructor/newtarget-undefined.js index 61df1fe290b6..66e666119a64 100644 --- a/js/src/tests/test262/intl402/ListFormat/constructor/constructor/newtarget-undefined.js +++ b/js/src/tests/test262/intl402/ListFormat/constructor/constructor/newtarget-undefined.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -13,6 +13,8 @@ info: | features: [Intl.ListFormat] ---*/ +assert.sameValue(typeof Intl.ListFormat, "function"); + assert.throws(TypeError, function() { Intl.ListFormat(); }); diff --git a/js/src/tests/test262/intl402/ListFormat/constructor/constructor/options-bad-combinations.js b/js/src/tests/test262/intl402/ListFormat/constructor/constructor/options-bad-combinations.js index 81d044027bb7..3118aa6bbdd2 100644 --- a/js/src/tests/test262/intl402/ListFormat/constructor/constructor/options-bad-combinations.js +++ b/js/src/tests/test262/intl402/ListFormat/constructor/constructor/options-bad-combinations.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/constructor/constructor/options-invalid.js b/js/src/tests/test262/intl402/ListFormat/constructor/constructor/options-invalid.js index 6bcae62ae77a..038e56cb5181 100644 --- a/js/src/tests/test262/intl402/ListFormat/constructor/constructor/options-invalid.js +++ b/js/src/tests/test262/intl402/ListFormat/constructor/constructor/options-invalid.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -12,6 +12,9 @@ info: | features: [Intl.ListFormat] ---*/ -assert.throws(TypeError, function() { new Intl.ListFormat([], null) }) +assert.sameValue(typeof Intl.ListFormat, "function"); +assert.throws(TypeError, function() { + new Intl.ListFormat([], null); +}); reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/ListFormat/constructor/constructor/options-localeMatcher-invalid.js b/js/src/tests/test262/intl402/ListFormat/constructor/constructor/options-localeMatcher-invalid.js index 8e8c894eb546..da0522630e48 100644 --- a/js/src/tests/test262/intl402/ListFormat/constructor/constructor/options-localeMatcher-invalid.js +++ b/js/src/tests/test262/intl402/ListFormat/constructor/constructor/options-localeMatcher-invalid.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/constructor/constructor/options-order.js b/js/src/tests/test262/intl402/ListFormat/constructor/constructor/options-order.js index fbfdcbec58c2..67daa70e8dc8 100644 --- a/js/src/tests/test262/intl402/ListFormat/constructor/constructor/options-order.js +++ b/js/src/tests/test262/intl402/ListFormat/constructor/constructor/options-order.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/constructor/constructor/options-style-invalid.js b/js/src/tests/test262/intl402/ListFormat/constructor/constructor/options-style-invalid.js index 38634b108d2a..6734e78109e4 100644 --- a/js/src/tests/test262/intl402/ListFormat/constructor/constructor/options-style-invalid.js +++ b/js/src/tests/test262/intl402/ListFormat/constructor/constructor/options-style-invalid.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/constructor/constructor/options-style-valid.js b/js/src/tests/test262/intl402/ListFormat/constructor/constructor/options-style-valid.js index 4915f86928db..b816a08efa5a 100644 --- a/js/src/tests/test262/intl402/ListFormat/constructor/constructor/options-style-valid.js +++ b/js/src/tests/test262/intl402/ListFormat/constructor/constructor/options-style-valid.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/constructor/constructor/options-throwing-getters.js b/js/src/tests/test262/intl402/ListFormat/constructor/constructor/options-throwing-getters.js index ae3f8bd13e73..c0d728d58594 100644 --- a/js/src/tests/test262/intl402/ListFormat/constructor/constructor/options-throwing-getters.js +++ b/js/src/tests/test262/intl402/ListFormat/constructor/constructor/options-throwing-getters.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/constructor/constructor/options-toobject-prototype.js b/js/src/tests/test262/intl402/ListFormat/constructor/constructor/options-toobject-prototype.js index 8fc60e7c9b9a..005c2faf2180 100644 --- a/js/src/tests/test262/intl402/ListFormat/constructor/constructor/options-toobject-prototype.js +++ b/js/src/tests/test262/intl402/ListFormat/constructor/constructor/options-toobject-prototype.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/constructor/constructor/options-toobject.js b/js/src/tests/test262/intl402/ListFormat/constructor/constructor/options-toobject.js index 59ae145dc892..2230e2bfe759 100644 --- a/js/src/tests/test262/intl402/ListFormat/constructor/constructor/options-toobject.js +++ b/js/src/tests/test262/intl402/ListFormat/constructor/constructor/options-toobject.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/constructor/constructor/options-type-invalid.js b/js/src/tests/test262/intl402/ListFormat/constructor/constructor/options-type-invalid.js index d63241ec3e1d..7af4e5142377 100644 --- a/js/src/tests/test262/intl402/ListFormat/constructor/constructor/options-type-invalid.js +++ b/js/src/tests/test262/intl402/ListFormat/constructor/constructor/options-type-invalid.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/constructor/constructor/options-type-valid.js b/js/src/tests/test262/intl402/ListFormat/constructor/constructor/options-type-valid.js index 8ec71253369c..110f5974f693 100644 --- a/js/src/tests/test262/intl402/ListFormat/constructor/constructor/options-type-valid.js +++ b/js/src/tests/test262/intl402/ListFormat/constructor/constructor/options-type-valid.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/constructor/constructor/options-undefined.js b/js/src/tests/test262/intl402/ListFormat/constructor/constructor/options-undefined.js index 60b12617dca9..61f90b2cfa44 100644 --- a/js/src/tests/test262/intl402/ListFormat/constructor/constructor/options-undefined.js +++ b/js/src/tests/test262/intl402/ListFormat/constructor/constructor/options-undefined.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/constructor/constructor/subclassing.js b/js/src/tests/test262/intl402/ListFormat/constructor/constructor/subclassing.js index 4731826fbeb7..4d6fe9e1b2ed 100644 --- a/js/src/tests/test262/intl402/ListFormat/constructor/constructor/subclassing.js +++ b/js/src/tests/test262/intl402/ListFormat/constructor/constructor/subclassing.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/constructor/length.js b/js/src/tests/test262/intl402/ListFormat/constructor/length.js index 3fe1d9b4bf91..471849f33124 100644 --- a/js/src/tests/test262/intl402/ListFormat/constructor/length.js +++ b/js/src/tests/test262/intl402/ListFormat/constructor/length.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/constructor/name.js b/js/src/tests/test262/intl402/ListFormat/constructor/name.js index ed0a46097f80..265d4f65157a 100644 --- a/js/src/tests/test262/intl402/ListFormat/constructor/name.js +++ b/js/src/tests/test262/intl402/ListFormat/constructor/name.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/constructor/prop-desc.js b/js/src/tests/test262/intl402/ListFormat/constructor/prop-desc.js index 32c63b5c4c31..3999e6e5bb4e 100644 --- a/js/src/tests/test262/intl402/ListFormat/constructor/prop-desc.js +++ b/js/src/tests/test262/intl402/ListFormat/constructor/prop-desc.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/constructor/prototype.js b/js/src/tests/test262/intl402/ListFormat/constructor/prototype.js index 169be7b8563f..ca1ac01c38f4 100644 --- a/js/src/tests/test262/intl402/ListFormat/constructor/prototype.js +++ b/js/src/tests/test262/intl402/ListFormat/constructor/prototype.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/constructor/supportedLocalesOf/basic.js b/js/src/tests/test262/intl402/ListFormat/constructor/supportedLocalesOf/basic.js index 53bcb36db0ae..867b5824ae28 100644 --- a/js/src/tests/test262/intl402/ListFormat/constructor/supportedLocalesOf/basic.js +++ b/js/src/tests/test262/intl402/ListFormat/constructor/supportedLocalesOf/basic.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Google Inc., Igalia S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/constructor/supportedLocalesOf/branding.js b/js/src/tests/test262/intl402/ListFormat/constructor/supportedLocalesOf/branding.js index 79a18a22c3c8..8d9bd9634166 100644 --- a/js/src/tests/test262/intl402/ListFormat/constructor/supportedLocalesOf/branding.js +++ b/js/src/tests/test262/intl402/ListFormat/constructor/supportedLocalesOf/branding.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/constructor/supportedLocalesOf/length.js b/js/src/tests/test262/intl402/ListFormat/constructor/supportedLocalesOf/length.js index 360a63e9b257..2281cd5b9f30 100644 --- a/js/src/tests/test262/intl402/ListFormat/constructor/supportedLocalesOf/length.js +++ b/js/src/tests/test262/intl402/ListFormat/constructor/supportedLocalesOf/length.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/constructor/supportedLocalesOf/locales-invalid.js b/js/src/tests/test262/intl402/ListFormat/constructor/supportedLocalesOf/locales-invalid.js index 1f13c6e4503a..f4d97cf949f7 100644 --- a/js/src/tests/test262/intl402/ListFormat/constructor/supportedLocalesOf/locales-invalid.js +++ b/js/src/tests/test262/intl402/ListFormat/constructor/supportedLocalesOf/locales-invalid.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/constructor/supportedLocalesOf/name.js b/js/src/tests/test262/intl402/ListFormat/constructor/supportedLocalesOf/name.js index 2ab42e379b10..34bc8fe0e910 100644 --- a/js/src/tests/test262/intl402/ListFormat/constructor/supportedLocalesOf/name.js +++ b/js/src/tests/test262/intl402/ListFormat/constructor/supportedLocalesOf/name.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/constructor/supportedLocalesOf/options-localeMatcher-invalid.js b/js/src/tests/test262/intl402/ListFormat/constructor/supportedLocalesOf/options-localeMatcher-invalid.js index 822b15c8b64e..abd7dd98e6b9 100644 --- a/js/src/tests/test262/intl402/ListFormat/constructor/supportedLocalesOf/options-localeMatcher-invalid.js +++ b/js/src/tests/test262/intl402/ListFormat/constructor/supportedLocalesOf/options-localeMatcher-invalid.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/constructor/supportedLocalesOf/options-null.js b/js/src/tests/test262/intl402/ListFormat/constructor/supportedLocalesOf/options-null.js index e78d80ea99a8..6ff2d511de18 100644 --- a/js/src/tests/test262/intl402/ListFormat/constructor/supportedLocalesOf/options-null.js +++ b/js/src/tests/test262/intl402/ListFormat/constructor/supportedLocalesOf/options-null.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/constructor/supportedLocalesOf/options-toobject.js b/js/src/tests/test262/intl402/ListFormat/constructor/supportedLocalesOf/options-toobject.js index 770b9976030b..7c2c53c3ef73 100644 --- a/js/src/tests/test262/intl402/ListFormat/constructor/supportedLocalesOf/options-toobject.js +++ b/js/src/tests/test262/intl402/ListFormat/constructor/supportedLocalesOf/options-toobject.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/constructor/supportedLocalesOf/options-undefined.js b/js/src/tests/test262/intl402/ListFormat/constructor/supportedLocalesOf/options-undefined.js index fdab00793439..e3d136488b70 100644 --- a/js/src/tests/test262/intl402/ListFormat/constructor/supportedLocalesOf/options-undefined.js +++ b/js/src/tests/test262/intl402/ListFormat/constructor/supportedLocalesOf/options-undefined.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/constructor/supportedLocalesOf/prop-desc.js b/js/src/tests/test262/intl402/ListFormat/constructor/supportedLocalesOf/prop-desc.js index b660fa7bc0a7..b1c344241eb9 100644 --- a/js/src/tests/test262/intl402/ListFormat/constructor/supportedLocalesOf/prop-desc.js +++ b/js/src/tests/test262/intl402/ListFormat/constructor/supportedLocalesOf/prop-desc.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/constructor/supportedLocalesOf/result-type.js b/js/src/tests/test262/intl402/ListFormat/constructor/supportedLocalesOf/result-type.js index ddb8fc2da4e2..f33e1122989e 100644 --- a/js/src/tests/test262/intl402/ListFormat/constructor/supportedLocalesOf/result-type.js +++ b/js/src/tests/test262/intl402/ListFormat/constructor/supportedLocalesOf/result-type.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/instance/extensibility.js b/js/src/tests/test262/intl402/ListFormat/instance/extensibility.js index 3503f02aa090..0dc0dfae2d04 100644 --- a/js/src/tests/test262/intl402/ListFormat/instance/extensibility.js +++ b/js/src/tests/test262/intl402/ListFormat/instance/extensibility.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/instance/prototype.js b/js/src/tests/test262/intl402/ListFormat/instance/prototype.js index 968fc481b5cb..fe3f01c31631 100644 --- a/js/src/tests/test262/intl402/ListFormat/instance/prototype.js +++ b/js/src/tests/test262/intl402/ListFormat/instance/prototype.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/prototype/constructor/prop-desc.js b/js/src/tests/test262/intl402/ListFormat/prototype/constructor/prop-desc.js index 835026163621..148822862457 100644 --- a/js/src/tests/test262/intl402/ListFormat/prototype/constructor/prop-desc.js +++ b/js/src/tests/test262/intl402/ListFormat/prototype/constructor/prop-desc.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/prototype/format/branding.js b/js/src/tests/test262/intl402/ListFormat/prototype/format/branding.js index 5407b2418ffd..1581c81ca09c 100644 --- a/js/src/tests/test262/intl402/ListFormat/prototype/format/branding.js +++ b/js/src/tests/test262/intl402/ListFormat/prototype/format/branding.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -13,16 +13,18 @@ info: | features: [Intl.ListFormat] ---*/ -const fn = Intl.ListFormat.prototype.format; +const format = Intl.ListFormat.prototype.format; -assert.throws(TypeError, () => fn.call(undefined), "undefined"); -assert.throws(TypeError, () => fn.call(null), "null"); -assert.throws(TypeError, () => fn.call(true), "true"); -assert.throws(TypeError, () => fn.call(""), "empty string"); -assert.throws(TypeError, () => fn.call(Symbol()), "symbol"); -assert.throws(TypeError, () => fn.call(1), "1"); -assert.throws(TypeError, () => fn.call({}), "plain object"); -assert.throws(TypeError, () => fn.call(Intl.ListFormat), "Intl.ListFormat"); -assert.throws(TypeError, () => fn.call(Intl.ListFormat.prototype), "Intl.ListFormat.prototype"); +assert.sameValue(typeof format, "function"); + +assert.throws(TypeError, () => format.call(undefined), "undefined"); +assert.throws(TypeError, () => format.call(null), "null"); +assert.throws(TypeError, () => format.call(true), "true"); +assert.throws(TypeError, () => format.call(""), "empty string"); +assert.throws(TypeError, () => format.call(Symbol()), "symbol"); +assert.throws(TypeError, () => format.call(1), "1"); +assert.throws(TypeError, () => format.call({}), "plain object"); +assert.throws(TypeError, () => format.call(Intl.ListFormat), "Intl.ListFormat"); +assert.throws(TypeError, () => format.call(Intl.ListFormat.prototype), "Intl.ListFormat.prototype"); reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/ListFormat/prototype/format/en-us-default.js b/js/src/tests/test262/intl402/ListFormat/prototype/format/en-us-default.js index 5bf6f338242b..7e8d879d05c1 100644 --- a/js/src/tests/test262/intl402/ListFormat/prototype/format/en-us-default.js +++ b/js/src/tests/test262/intl402/ListFormat/prototype/format/en-us-default.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/prototype/format/en-us-disjunction.js b/js/src/tests/test262/intl402/ListFormat/prototype/format/en-us-disjunction.js index 525e2a690402..b44011777397 100644 --- a/js/src/tests/test262/intl402/ListFormat/prototype/format/en-us-disjunction.js +++ b/js/src/tests/test262/intl402/ListFormat/prototype/format/en-us-disjunction.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/prototype/format/en-us-narrow.js b/js/src/tests/test262/intl402/ListFormat/prototype/format/en-us-narrow.js index 014299942900..f0ac68a28998 100644 --- a/js/src/tests/test262/intl402/ListFormat/prototype/format/en-us-narrow.js +++ b/js/src/tests/test262/intl402/ListFormat/prototype/format/en-us-narrow.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/prototype/format/en-us-short.js b/js/src/tests/test262/intl402/ListFormat/prototype/format/en-us-short.js index e24b7536a662..eadf0742db1d 100644 --- a/js/src/tests/test262/intl402/ListFormat/prototype/format/en-us-short.js +++ b/js/src/tests/test262/intl402/ListFormat/prototype/format/en-us-short.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/prototype/format/en-us-unit.js b/js/src/tests/test262/intl402/ListFormat/prototype/format/en-us-unit.js index b350b4f2bb9a..68e0b2665b64 100644 --- a/js/src/tests/test262/intl402/ListFormat/prototype/format/en-us-unit.js +++ b/js/src/tests/test262/intl402/ListFormat/prototype/format/en-us-unit.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/prototype/format/es-es-long.js b/js/src/tests/test262/intl402/ListFormat/prototype/format/es-es-long.js index 0133a389f848..37b3ae8b8244 100644 --- a/js/src/tests/test262/intl402/ListFormat/prototype/format/es-es-long.js +++ b/js/src/tests/test262/intl402/ListFormat/prototype/format/es-es-long.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/prototype/format/es-es-narrow.js b/js/src/tests/test262/intl402/ListFormat/prototype/format/es-es-narrow.js index 8042f1a5b6a3..3615b709b1a6 100644 --- a/js/src/tests/test262/intl402/ListFormat/prototype/format/es-es-narrow.js +++ b/js/src/tests/test262/intl402/ListFormat/prototype/format/es-es-narrow.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/prototype/format/es-es-short.js b/js/src/tests/test262/intl402/ListFormat/prototype/format/es-es-short.js index c74db5f95dcc..ffdb82031998 100644 --- a/js/src/tests/test262/intl402/ListFormat/prototype/format/es-es-short.js +++ b/js/src/tests/test262/intl402/ListFormat/prototype/format/es-es-short.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/prototype/format/length.js b/js/src/tests/test262/intl402/ListFormat/prototype/format/length.js index 8943a9df6ef3..e4701f6e6756 100644 --- a/js/src/tests/test262/intl402/ListFormat/prototype/format/length.js +++ b/js/src/tests/test262/intl402/ListFormat/prototype/format/length.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/prototype/format/name.js b/js/src/tests/test262/intl402/ListFormat/prototype/format/name.js index 681b846edcbd..05b9761bc158 100644 --- a/js/src/tests/test262/intl402/ListFormat/prototype/format/name.js +++ b/js/src/tests/test262/intl402/ListFormat/prototype/format/name.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/prototype/format/prop-desc.js b/js/src/tests/test262/intl402/ListFormat/prototype/format/prop-desc.js index 2fe5f3c0f06e..f1b4e4469714 100644 --- a/js/src/tests/test262/intl402/ListFormat/prototype/format/prop-desc.js +++ b/js/src/tests/test262/intl402/ListFormat/prototype/format/prop-desc.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/prototype/formatToParts/branding.js b/js/src/tests/test262/intl402/ListFormat/prototype/formatToParts/branding.js index 9cae1b4246f9..e553d235424a 100644 --- a/js/src/tests/test262/intl402/ListFormat/prototype/formatToParts/branding.js +++ b/js/src/tests/test262/intl402/ListFormat/prototype/formatToParts/branding.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -13,16 +13,17 @@ info: | features: [Intl.ListFormat] ---*/ -const fn = Intl.ListFormat.prototype.formatToParts; +const formatToParts = Intl.ListFormat.prototype.formatToParts; -assert.throws(TypeError, () => fn.call(undefined), "undefined"); -assert.throws(TypeError, () => fn.call(null), "null"); -assert.throws(TypeError, () => fn.call(true), "true"); -assert.throws(TypeError, () => fn.call(""), "empty string"); -assert.throws(TypeError, () => fn.call(Symbol()), "symbol"); -assert.throws(TypeError, () => fn.call(1), "1"); -assert.throws(TypeError, () => fn.call({}), "plain object"); -assert.throws(TypeError, () => fn.call(Intl.ListFormat), "Intl.ListFormat"); -assert.throws(TypeError, () => fn.call(Intl.ListFormat.prototype), "Intl.ListFormat.prototype"); +assert.sameValue(typeof formatToParts, "function"); +assert.throws(TypeError, () => formatToParts.call(undefined), "undefined"); +assert.throws(TypeError, () => formatToParts.call(null), "null"); +assert.throws(TypeError, () => formatToParts.call(true), "true"); +assert.throws(TypeError, () => formatToParts.call(""), "empty string"); +assert.throws(TypeError, () => formatToParts.call(Symbol()), "symbol"); +assert.throws(TypeError, () => formatToParts.call(1), "1"); +assert.throws(TypeError, () => formatToParts.call({}), "plain object"); +assert.throws(TypeError, () => formatToParts.call(Intl.ListFormat), "Intl.ListFormat"); +assert.throws(TypeError, () => formatToParts.call(Intl.ListFormat.prototype), "Intl.ListFormat.prototype"); reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/ListFormat/prototype/formatToParts/en-us-default.js b/js/src/tests/test262/intl402/ListFormat/prototype/formatToParts/en-us-default.js index 2f394087bfcb..685d4fd29b7b 100644 --- a/js/src/tests/test262/intl402/ListFormat/prototype/formatToParts/en-us-default.js +++ b/js/src/tests/test262/intl402/ListFormat/prototype/formatToParts/en-us-default.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/prototype/formatToParts/en-us-disjunction.js b/js/src/tests/test262/intl402/ListFormat/prototype/formatToParts/en-us-disjunction.js index 10d156ba740a..468978bac75c 100644 --- a/js/src/tests/test262/intl402/ListFormat/prototype/formatToParts/en-us-disjunction.js +++ b/js/src/tests/test262/intl402/ListFormat/prototype/formatToParts/en-us-disjunction.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/prototype/formatToParts/en-us-narrow.js b/js/src/tests/test262/intl402/ListFormat/prototype/formatToParts/en-us-narrow.js index 551e80f42569..737009811621 100644 --- a/js/src/tests/test262/intl402/ListFormat/prototype/formatToParts/en-us-narrow.js +++ b/js/src/tests/test262/intl402/ListFormat/prototype/formatToParts/en-us-narrow.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/prototype/formatToParts/en-us-short.js b/js/src/tests/test262/intl402/ListFormat/prototype/formatToParts/en-us-short.js index c1b4f53cb5e8..07c88a55c32b 100644 --- a/js/src/tests/test262/intl402/ListFormat/prototype/formatToParts/en-us-short.js +++ b/js/src/tests/test262/intl402/ListFormat/prototype/formatToParts/en-us-short.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/prototype/formatToParts/en-us-unit.js b/js/src/tests/test262/intl402/ListFormat/prototype/formatToParts/en-us-unit.js index 7cee79982a93..f85813a0372f 100644 --- a/js/src/tests/test262/intl402/ListFormat/prototype/formatToParts/en-us-unit.js +++ b/js/src/tests/test262/intl402/ListFormat/prototype/formatToParts/en-us-unit.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/prototype/formatToParts/es-es-long.js b/js/src/tests/test262/intl402/ListFormat/prototype/formatToParts/es-es-long.js index c08e3dbaed4a..ab5df32111c3 100644 --- a/js/src/tests/test262/intl402/ListFormat/prototype/formatToParts/es-es-long.js +++ b/js/src/tests/test262/intl402/ListFormat/prototype/formatToParts/es-es-long.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/prototype/formatToParts/es-es-narrow.js b/js/src/tests/test262/intl402/ListFormat/prototype/formatToParts/es-es-narrow.js index 6c3e2ace4937..1f58da3f18d4 100644 --- a/js/src/tests/test262/intl402/ListFormat/prototype/formatToParts/es-es-narrow.js +++ b/js/src/tests/test262/intl402/ListFormat/prototype/formatToParts/es-es-narrow.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/prototype/formatToParts/es-es-short.js b/js/src/tests/test262/intl402/ListFormat/prototype/formatToParts/es-es-short.js index f3fd353b15ca..e46a29158338 100644 --- a/js/src/tests/test262/intl402/ListFormat/prototype/formatToParts/es-es-short.js +++ b/js/src/tests/test262/intl402/ListFormat/prototype/formatToParts/es-es-short.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/prototype/formatToParts/length.js b/js/src/tests/test262/intl402/ListFormat/prototype/formatToParts/length.js index b46a2f49f030..cc4c19091ad5 100644 --- a/js/src/tests/test262/intl402/ListFormat/prototype/formatToParts/length.js +++ b/js/src/tests/test262/intl402/ListFormat/prototype/formatToParts/length.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/prototype/formatToParts/name.js b/js/src/tests/test262/intl402/ListFormat/prototype/formatToParts/name.js index 4ae44def376a..c2aceabf73a9 100644 --- a/js/src/tests/test262/intl402/ListFormat/prototype/formatToParts/name.js +++ b/js/src/tests/test262/intl402/ListFormat/prototype/formatToParts/name.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/prototype/formatToParts/prop-desc.js b/js/src/tests/test262/intl402/ListFormat/prototype/formatToParts/prop-desc.js index d0903fc41e98..35663874f54c 100644 --- a/js/src/tests/test262/intl402/ListFormat/prototype/formatToParts/prop-desc.js +++ b/js/src/tests/test262/intl402/ListFormat/prototype/formatToParts/prop-desc.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/prototype/prop-desc.js b/js/src/tests/test262/intl402/ListFormat/prototype/prop-desc.js index 9d4b6d9f54c8..649bbf130739 100644 --- a/js/src/tests/test262/intl402/ListFormat/prototype/prop-desc.js +++ b/js/src/tests/test262/intl402/ListFormat/prototype/prop-desc.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/prototype/resolvedOptions/branding.js b/js/src/tests/test262/intl402/ListFormat/prototype/resolvedOptions/branding.js index 1bbfa05c9199..9be8930a3d2c 100644 --- a/js/src/tests/test262/intl402/ListFormat/prototype/resolvedOptions/branding.js +++ b/js/src/tests/test262/intl402/ListFormat/prototype/resolvedOptions/branding.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -13,16 +13,17 @@ info: | features: [Intl.ListFormat] ---*/ -const fn = Intl.ListFormat.prototype.resolvedOptions; +const resolvedOptions = Intl.ListFormat.prototype.resolvedOptions; -assert.throws(TypeError, () => fn.call(undefined), "undefined"); -assert.throws(TypeError, () => fn.call(null), "null"); -assert.throws(TypeError, () => fn.call(true), "true"); -assert.throws(TypeError, () => fn.call(""), "empty string"); -assert.throws(TypeError, () => fn.call(Symbol()), "symbol"); -assert.throws(TypeError, () => fn.call(1), "1"); -assert.throws(TypeError, () => fn.call({}), "plain object"); -assert.throws(TypeError, () => fn.call(Intl.ListFormat), "Intl.ListFormat"); -assert.throws(TypeError, () => fn.call(Intl.ListFormat.prototype), "Intl.ListFormat.prototype"); +assert.sameValue(typeof resolvedOptions, "function"); +assert.throws(TypeError, () => resolvedOptions.call(undefined), "undefined"); +assert.throws(TypeError, () => resolvedOptions.call(null), "null"); +assert.throws(TypeError, () => resolvedOptions.call(true), "true"); +assert.throws(TypeError, () => resolvedOptions.call(""), "empty string"); +assert.throws(TypeError, () => resolvedOptions.call(Symbol()), "symbol"); +assert.throws(TypeError, () => resolvedOptions.call(1), "1"); +assert.throws(TypeError, () => resolvedOptions.call({}), "plain object"); +assert.throws(TypeError, () => resolvedOptions.call(Intl.ListFormat), "Intl.ListFormat"); +assert.throws(TypeError, () => resolvedOptions.call(Intl.ListFormat.prototype), "Intl.ListFormat.prototype"); reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/ListFormat/prototype/resolvedOptions/caching.js b/js/src/tests/test262/intl402/ListFormat/prototype/resolvedOptions/caching.js index 05c747151148..a9a8c3c811f5 100644 --- a/js/src/tests/test262/intl402/ListFormat/prototype/resolvedOptions/caching.js +++ b/js/src/tests/test262/intl402/ListFormat/prototype/resolvedOptions/caching.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/prototype/resolvedOptions/length.js b/js/src/tests/test262/intl402/ListFormat/prototype/resolvedOptions/length.js index 511ff1d1a9ec..22ba1993f845 100644 --- a/js/src/tests/test262/intl402/ListFormat/prototype/resolvedOptions/length.js +++ b/js/src/tests/test262/intl402/ListFormat/prototype/resolvedOptions/length.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/prototype/resolvedOptions/name.js b/js/src/tests/test262/intl402/ListFormat/prototype/resolvedOptions/name.js index 7074b0ab0c75..7a1b0762c467 100644 --- a/js/src/tests/test262/intl402/ListFormat/prototype/resolvedOptions/name.js +++ b/js/src/tests/test262/intl402/ListFormat/prototype/resolvedOptions/name.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/prototype/resolvedOptions/order.js b/js/src/tests/test262/intl402/ListFormat/prototype/resolvedOptions/order.js index a3649a0e8e27..68608be3d1e9 100644 --- a/js/src/tests/test262/intl402/ListFormat/prototype/resolvedOptions/order.js +++ b/js/src/tests/test262/intl402/ListFormat/prototype/resolvedOptions/order.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/prototype/resolvedOptions/prop-desc.js b/js/src/tests/test262/intl402/ListFormat/prototype/resolvedOptions/prop-desc.js index 7ab314e192be..08fe8526e96b 100644 --- a/js/src/tests/test262/intl402/ListFormat/prototype/resolvedOptions/prop-desc.js +++ b/js/src/tests/test262/intl402/ListFormat/prototype/resolvedOptions/prop-desc.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/prototype/resolvedOptions/type.js b/js/src/tests/test262/intl402/ListFormat/prototype/resolvedOptions/type.js index a5ac7b0662b4..58678cf8259e 100644 --- a/js/src/tests/test262/intl402/ListFormat/prototype/resolvedOptions/type.js +++ b/js/src/tests/test262/intl402/ListFormat/prototype/resolvedOptions/type.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/prototype/toStringTag/toString.js b/js/src/tests/test262/intl402/ListFormat/prototype/toStringTag/toString.js index 3635e43951d6..797629d479e5 100644 --- a/js/src/tests/test262/intl402/ListFormat/prototype/toStringTag/toString.js +++ b/js/src/tests/test262/intl402/ListFormat/prototype/toStringTag/toString.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/ListFormat/prototype/toStringTag/toStringTag.js b/js/src/tests/test262/intl402/ListFormat/prototype/toStringTag/toStringTag.js index 7ae04466f245..e987b4d49fc6 100644 --- a/js/src/tests/test262/intl402/ListFormat/prototype/toStringTag/toStringTag.js +++ b/js/src/tests/test262/intl402/ListFormat/prototype/toStringTag/toStringTag.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('ListFormat')) -- Intl.ListFormat is not enabled unconditionally +// |reftest| skip -- Intl.ListFormat is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Locale/prototype/maximize/branding.js b/js/src/tests/test262/intl402/Locale/prototype/maximize/branding.js index 828d2950e5a4..18765bdfc5c1 100644 --- a/js/src/tests/test262/intl402/Locale/prototype/maximize/branding.js +++ b/js/src/tests/test262/intl402/Locale/prototype/maximize/branding.js @@ -14,7 +14,10 @@ info: | features: [Intl.Locale] ---*/ -const fn = Intl.Locale.prototype.maximize; +const maximize = Intl.Locale.prototype.maximize; + +assert.sameValue(typeof maximize, "function"); + const invalidValues = [ undefined, null, @@ -27,7 +30,7 @@ const invalidValues = [ ]; for (const invalidValue of invalidValues) { - assert.throws(TypeError, () => fn.call(invalidValue)); + assert.throws(TypeError, () => maximize.call(invalidValue)); } reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/Locale/prototype/minimize/branding.js b/js/src/tests/test262/intl402/Locale/prototype/minimize/branding.js index 6b2b3f5afe58..285586b5ff46 100644 --- a/js/src/tests/test262/intl402/Locale/prototype/minimize/branding.js +++ b/js/src/tests/test262/intl402/Locale/prototype/minimize/branding.js @@ -14,7 +14,10 @@ info: | features: [Intl.Locale] ---*/ -const fn = Intl.Locale.prototype.minimize; +const minimize = Intl.Locale.prototype.minimize; + +assert.sameValue(typeof minimize, "function"); + const invalidValues = [ undefined, null, @@ -27,7 +30,7 @@ const invalidValues = [ ]; for (const invalidValue of invalidValues) { - assert.throws(TypeError, () => fn.call(invalidValue)); + assert.throws(TypeError, () => minimize.call(invalidValue)); } reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/Locale/prototype/toString/branding.js b/js/src/tests/test262/intl402/Locale/prototype/toString/branding.js index 98bfecc381da..a1925b7e97ad 100644 --- a/js/src/tests/test262/intl402/Locale/prototype/toString/branding.js +++ b/js/src/tests/test262/intl402/Locale/prototype/toString/branding.js @@ -14,7 +14,10 @@ info: | features: [Intl.Locale] ---*/ -const fn = Intl.Locale.prototype.toString; +const toString = Intl.Locale.prototype.toString; + +assert.sameValue(typeof toString, "function"); + const invalidValues = [ undefined, null, @@ -27,7 +30,7 @@ const invalidValues = [ ]; for (const invalidValue of invalidValues) { - assert.throws(TypeError, () => fn.call(invalidValue)); + assert.throws(TypeError, () => toString.call(invalidValue)); } reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/NumberFormat/currencyDisplay-unit.js b/js/src/tests/test262/intl402/NumberFormat/currencyDisplay-unit.js new file mode 100644 index 000000000000..d38224316f23 --- /dev/null +++ b/js/src/tests/test262/intl402/NumberFormat/currencyDisplay-unit.js @@ -0,0 +1,43 @@ +// |reftest| skip -- Intl.NumberFormat-unified is not supported +// Copyright 2018 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-setnumberformatunitoptions +description: Checks handling of valid values for the numeric option to the RelativeTimeFormat constructor. +info: | + SetNumberFormatUnitOptions ( intlObj, options ) + + 6. Let currencyDisplay be ? GetOption(options, "currencyDisplay", "string", « "code", "symbol", "narrow-symbol", "name" », "symbol"). + 11. If style is "currency", then + f. Set intlObj.[[CurrencyDisplay]] to currencyDisplay. + +features: [Intl.NumberFormat-unified] +---*/ + +const validOptions = [ + [undefined, "symbol"], + ["narrow-symbol", "narrow-symbol"], + [{ toString() { return "narrow-symbol"; } }, "narrow-symbol"], +]; + +for (const [validOption, expected] of validOptions) { + const nf = new Intl.NumberFormat([], { + "style": "currency", + "currency": "EUR", + "currencyDisplay": validOption, + }); + const resolvedOptions = nf.resolvedOptions(); + assert.sameValue(resolvedOptions.currencyDisplay, expected); +} + +for (const [validOption] of validOptions) { + const nf = new Intl.NumberFormat([], { + "style": "percent", + "currencyDisplay": validOption, + }); + const resolvedOptions = nf.resolvedOptions(); + assert.sameValue(resolvedOptions.currencyDisplay, undefined); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/NumberFormat/style-unit.js b/js/src/tests/test262/intl402/NumberFormat/style-unit.js new file mode 100644 index 000000000000..0470287b712d --- /dev/null +++ b/js/src/tests/test262/intl402/NumberFormat/style-unit.js @@ -0,0 +1,29 @@ +// |reftest| skip -- Intl.NumberFormat-unified is not supported +// Copyright 2018 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-setnumberformatunitoptions +description: Checks handling of valid values for the numeric option to the RelativeTimeFormat constructor. +info: | + SetNumberFormatUnitOptions ( intlObj, options ) + + 3. Let style be ? GetOption(options, "style", "string", « "decimal", "percent", "currency", "unit" », "decimal"). + 4. Set intlObj.[[Style]] to style. + +features: [Intl.NumberFormat-unified] +---*/ + +const validOptions = [ + [undefined, "decimal"], + ["unit", "unit"], + [{ toString() { return "unit"; } }, "unit"], +]; + +for (const [validOption, expected] of validOptions) { + const nf = new Intl.NumberFormat([], {"style": validOption, "unit": "generic"}); + const resolvedOptions = nf.resolvedOptions(); + assert.sameValue(resolvedOptions.style, expected); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/RelativeTimeFormat/constructor/supportedLocalesOf/branding.js b/js/src/tests/test262/intl402/RelativeTimeFormat/constructor/supportedLocalesOf/branding.js index 1ce1b498c801..fa89f86ba0e4 100644 --- a/js/src/tests/test262/intl402/RelativeTimeFormat/constructor/supportedLocalesOf/branding.js +++ b/js/src/tests/test262/intl402/RelativeTimeFormat/constructor/supportedLocalesOf/branding.js @@ -10,7 +10,10 @@ info: | features: [Intl.RelativeTimeFormat] ---*/ -const fn = Intl.RelativeTimeFormat.supportedLocalesOf; +const supportedLocalesOf = Intl.RelativeTimeFormat.supportedLocalesOf; + +assert.sameValue(typeof supportedLocalesOf, "function"); + const thisValues = [ undefined, null, @@ -24,7 +27,7 @@ const thisValues = [ ]; for (const thisValue of thisValues) { - const result = fn.call(thisValue); + const result = supportedLocalesOf.call(thisValue); assert.sameValue(Array.isArray(result), true); } diff --git a/js/src/tests/test262/intl402/RelativeTimeFormat/prototype/format/branding.js b/js/src/tests/test262/intl402/RelativeTimeFormat/prototype/format/branding.js index a641049cc1ba..fa7f890ad767 100644 --- a/js/src/tests/test262/intl402/RelativeTimeFormat/prototype/format/branding.js +++ b/js/src/tests/test262/intl402/RelativeTimeFormat/prototype/format/branding.js @@ -11,16 +11,18 @@ info: | features: [Intl.RelativeTimeFormat] ---*/ -const fn = Intl.RelativeTimeFormat.prototype.format; +const format = Intl.RelativeTimeFormat.prototype.format; -assert.throws(TypeError, () => fn.call(undefined), "undefined"); -assert.throws(TypeError, () => fn.call(null), "null"); -assert.throws(TypeError, () => fn.call(true), "true"); -assert.throws(TypeError, () => fn.call(""), "empty string"); -assert.throws(TypeError, () => fn.call(Symbol()), "symbol"); -assert.throws(TypeError, () => fn.call(1), "1"); -assert.throws(TypeError, () => fn.call({}), "plain object"); -assert.throws(TypeError, () => fn.call(Intl.RelativeTimeFormat), "Intl.RelativeTimeFormat"); -assert.throws(TypeError, () => fn.call(Intl.RelativeTimeFormat.prototype), "Intl.RelativeTimeFormat.prototype"); +assert.sameValue(typeof format, "function"); + +assert.throws(TypeError, () => format.call(undefined), "undefined"); +assert.throws(TypeError, () => format.call(null), "null"); +assert.throws(TypeError, () => format.call(true), "true"); +assert.throws(TypeError, () => format.call(""), "empty string"); +assert.throws(TypeError, () => format.call(Symbol()), "symbol"); +assert.throws(TypeError, () => format.call(1), "1"); +assert.throws(TypeError, () => format.call({}), "plain object"); +assert.throws(TypeError, () => format.call(Intl.RelativeTimeFormat), "Intl.RelativeTimeFormat"); +assert.throws(TypeError, () => format.call(Intl.RelativeTimeFormat.prototype), "Intl.RelativeTimeFormat.prototype"); reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/RelativeTimeFormat/prototype/formatToParts/branding.js b/js/src/tests/test262/intl402/RelativeTimeFormat/prototype/formatToParts/branding.js index f07a8ec9fd72..fa5f00ad622e 100644 --- a/js/src/tests/test262/intl402/RelativeTimeFormat/prototype/formatToParts/branding.js +++ b/js/src/tests/test262/intl402/RelativeTimeFormat/prototype/formatToParts/branding.js @@ -11,16 +11,18 @@ info: | features: [Intl.RelativeTimeFormat] ---*/ -const fn = Intl.RelativeTimeFormat.prototype.formatToParts; +const formatToParts = Intl.RelativeTimeFormat.prototype.formatToParts; -assert.throws(TypeError, () => fn.call(undefined), "undefined"); -assert.throws(TypeError, () => fn.call(null), "null"); -assert.throws(TypeError, () => fn.call(true), "true"); -assert.throws(TypeError, () => fn.call(""), "empty string"); -assert.throws(TypeError, () => fn.call(Symbol()), "symbol"); -assert.throws(TypeError, () => fn.call(1), "1"); -assert.throws(TypeError, () => fn.call({}), "plain object"); -assert.throws(TypeError, () => fn.call(Intl.RelativeTimeFormat), "Intl.RelativeTimeFormat"); -assert.throws(TypeError, () => fn.call(Intl.RelativeTimeFormat.prototype), "Intl.RelativeTimeFormat.prototype"); +assert.sameValue(typeof formatToParts, "function"); + +assert.throws(TypeError, () => formatToParts.call(undefined), "undefined"); +assert.throws(TypeError, () => formatToParts.call(null), "null"); +assert.throws(TypeError, () => formatToParts.call(true), "true"); +assert.throws(TypeError, () => formatToParts.call(""), "empty string"); +assert.throws(TypeError, () => formatToParts.call(Symbol()), "symbol"); +assert.throws(TypeError, () => formatToParts.call(1), "1"); +assert.throws(TypeError, () => formatToParts.call({}), "plain object"); +assert.throws(TypeError, () => formatToParts.call(Intl.RelativeTimeFormat), "Intl.RelativeTimeFormat"); +assert.throws(TypeError, () => formatToParts.call(Intl.RelativeTimeFormat.prototype), "Intl.RelativeTimeFormat.prototype"); reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/RelativeTimeFormat/prototype/resolvedOptions/branding.js b/js/src/tests/test262/intl402/RelativeTimeFormat/prototype/resolvedOptions/branding.js index f8aac26b7b41..ba3ab34bee49 100644 --- a/js/src/tests/test262/intl402/RelativeTimeFormat/prototype/resolvedOptions/branding.js +++ b/js/src/tests/test262/intl402/RelativeTimeFormat/prototype/resolvedOptions/branding.js @@ -11,16 +11,18 @@ info: | features: [Intl.RelativeTimeFormat] ---*/ -const fn = Intl.RelativeTimeFormat.prototype.resolvedOptions; +const resolvedOptions = Intl.RelativeTimeFormat.prototype.resolvedOptions; -assert.throws(TypeError, () => fn.call(undefined), "undefined"); -assert.throws(TypeError, () => fn.call(null), "null"); -assert.throws(TypeError, () => fn.call(true), "true"); -assert.throws(TypeError, () => fn.call(""), "empty string"); -assert.throws(TypeError, () => fn.call(Symbol()), "symbol"); -assert.throws(TypeError, () => fn.call(1), "1"); -assert.throws(TypeError, () => fn.call({}), "plain object"); -assert.throws(TypeError, () => fn.call(Intl.RelativeTimeFormat), "Intl.RelativeTimeFormat"); -assert.throws(TypeError, () => fn.call(Intl.RelativeTimeFormat.prototype), "Intl.RelativeTimeFormat.prototype"); +assert.sameValue(typeof resolvedOptions, "function"); + +assert.throws(TypeError, () => resolvedOptions.call(undefined), "undefined"); +assert.throws(TypeError, () => resolvedOptions.call(null), "null"); +assert.throws(TypeError, () => resolvedOptions.call(true), "true"); +assert.throws(TypeError, () => resolvedOptions.call(""), "empty string"); +assert.throws(TypeError, () => resolvedOptions.call(Symbol()), "symbol"); +assert.throws(TypeError, () => resolvedOptions.call(1), "1"); +assert.throws(TypeError, () => resolvedOptions.call({}), "plain object"); +assert.throws(TypeError, () => resolvedOptions.call(Intl.RelativeTimeFormat), "Intl.RelativeTimeFormat"); +assert.throws(TypeError, () => resolvedOptions.call(Intl.RelativeTimeFormat.prototype), "Intl.RelativeTimeFormat.prototype"); reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/Segmenter/constructor/constructor/locales-invalid.js b/js/src/tests/test262/intl402/Segmenter/constructor/constructor/locales-invalid.js index 088cfcaeaf4a..772e41ae59a9 100644 --- a/js/src/tests/test262/intl402/Segmenter/constructor/constructor/locales-invalid.js +++ b/js/src/tests/test262/intl402/Segmenter/constructor/constructor/locales-invalid.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/constructor/constructor/locales-valid.js b/js/src/tests/test262/intl402/Segmenter/constructor/constructor/locales-valid.js index c6d876c45a68..53cb17c5b51d 100644 --- a/js/src/tests/test262/intl402/Segmenter/constructor/constructor/locales-valid.js +++ b/js/src/tests/test262/intl402/Segmenter/constructor/constructor/locales-valid.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -16,21 +16,27 @@ features: [Intl.Segmenter] const defaultLocale = new Intl.Segmenter().resolvedOptions().locale; const tests = [ - [undefined, defaultLocale, "undefined"], - ["EN", "en", "Single value"], - [[], defaultLocale, "Empty array"], - [["en-GB-oed"], "en-GB", "Grandfathered"], - [["x-private"], defaultLocale, "Private", ["lookup"]], - [["en", "EN"], "en", "Duplicate value (canonical first)"], - [["EN", "en"], "en", "Duplicate value (canonical last)"], - [{ 0: "DE", length: 0 }, defaultLocale, "Object with zero length"], - [{ 0: "DE", length: 1 }, "de", "Object with length"], + [undefined, [defaultLocale], "undefined"], + ["EN", ["en"], "Single value"], + [[], [defaultLocale], "Empty array"], + [["sr"], ["sr"], "Single-element array"], + [["fr", "ar"], ["fr", "ar"], "Two-element array"], + [["xyz", "ar"], ["ar"], "Two-element array with unknown code"], + [["en-GB-oed"], ["en-GB"], "Grandfathered"], + [["x-private"], [defaultLocale], "Private", ["lookup"]], + [["en", "EN"], ["en"], "Duplicate value (canonical first)"], + [["EN", "en"], ["en"], "Duplicate value (canonical last)"], + [{ 0: "DE", length: 0 }, [defaultLocale], "Object with zero length"], + [{ 0: "DE", length: 1 }, ["de"], "Object with length"], + [{ 0: "ja", 1: "fr" }, [defaultLocale], "Object without length, indexed from 0"], + [{ 1: "ja", 2: "fr" }, [defaultLocale], "Object without length, indexed from 1"], ]; for (const [locales, expected, name, matchers = ["best fit", "lookup"]] of tests) { for (const localeMatcher of matchers) { const segmenter = new Intl.Segmenter(locales, { localeMatcher }); - assert.sameValue(segmenter.resolvedOptions().locale, expected, name); + const actual = segmenter.resolvedOptions().locale; + assert(expected.includes(actual), `${name}: expected one of ${expected}, found ${actual}`); } } diff --git a/js/src/tests/test262/intl402/Segmenter/constructor/constructor/newtarget-undefined.js b/js/src/tests/test262/intl402/Segmenter/constructor/constructor/newtarget-undefined.js index e4512a5ae73f..13fff4c3c2a4 100644 --- a/js/src/tests/test262/intl402/Segmenter/constructor/constructor/newtarget-undefined.js +++ b/js/src/tests/test262/intl402/Segmenter/constructor/constructor/newtarget-undefined.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/constructor/constructor/options-granularity-invalid.js b/js/src/tests/test262/intl402/Segmenter/constructor/constructor/options-granularity-invalid.js index a955f3c38267..845f88c2c177 100644 --- a/js/src/tests/test262/intl402/Segmenter/constructor/constructor/options-granularity-invalid.js +++ b/js/src/tests/test262/intl402/Segmenter/constructor/constructor/options-granularity-invalid.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -17,6 +17,7 @@ const invalidOptions = [ null, 1, "", + "standard", "Grapheme", "GRAPHEME", "grapheme\0", diff --git a/js/src/tests/test262/intl402/Segmenter/constructor/constructor/options-granularity-valid.js b/js/src/tests/test262/intl402/Segmenter/constructor/constructor/options-granularity-valid.js index 218ebe75851e..0ff00f7d4f66 100644 --- a/js/src/tests/test262/intl402/Segmenter/constructor/constructor/options-granularity-valid.js +++ b/js/src/tests/test262/intl402/Segmenter/constructor/constructor/options-granularity-valid.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/constructor/constructor/options-invalid.js b/js/src/tests/test262/intl402/Segmenter/constructor/constructor/options-invalid.js index 3d4b846a54a0..f0255bfd4fb2 100644 --- a/js/src/tests/test262/intl402/Segmenter/constructor/constructor/options-invalid.js +++ b/js/src/tests/test262/intl402/Segmenter/constructor/constructor/options-invalid.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/constructor/constructor/options-lineBreakStyle-invalid.js b/js/src/tests/test262/intl402/Segmenter/constructor/constructor/options-lineBreakStyle-invalid.js index c65dccd7e58c..a8662eeca49b 100644 --- a/js/src/tests/test262/intl402/Segmenter/constructor/constructor/options-lineBreakStyle-invalid.js +++ b/js/src/tests/test262/intl402/Segmenter/constructor/constructor/options-lineBreakStyle-invalid.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -18,6 +18,7 @@ const invalidOptions = [ null, 1, "", + "giant", "Strict", "STRICT", "strict\0", diff --git a/js/src/tests/test262/intl402/Segmenter/constructor/constructor/options-lineBreakStyle-valid.js b/js/src/tests/test262/intl402/Segmenter/constructor/constructor/options-lineBreakStyle-valid.js index 2a94ba8d30c0..14e4e8b06cf6 100644 --- a/js/src/tests/test262/intl402/Segmenter/constructor/constructor/options-lineBreakStyle-valid.js +++ b/js/src/tests/test262/intl402/Segmenter/constructor/constructor/options-lineBreakStyle-valid.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/constructor/constructor/options-localeMatcher-invalid.js b/js/src/tests/test262/intl402/Segmenter/constructor/constructor/options-localeMatcher-invalid.js index 0b786bec9e0d..72bfca89c47a 100644 --- a/js/src/tests/test262/intl402/Segmenter/constructor/constructor/options-localeMatcher-invalid.js +++ b/js/src/tests/test262/intl402/Segmenter/constructor/constructor/options-localeMatcher-invalid.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/constructor/constructor/options-order.js b/js/src/tests/test262/intl402/Segmenter/constructor/constructor/options-order.js index 7ac9b2499779..ae403b979e89 100644 --- a/js/src/tests/test262/intl402/Segmenter/constructor/constructor/options-order.js +++ b/js/src/tests/test262/intl402/Segmenter/constructor/constructor/options-order.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/constructor/constructor/options-throwing-getters.js b/js/src/tests/test262/intl402/Segmenter/constructor/constructor/options-throwing-getters.js index 0f51f04dc871..4656d59ac73b 100644 --- a/js/src/tests/test262/intl402/Segmenter/constructor/constructor/options-throwing-getters.js +++ b/js/src/tests/test262/intl402/Segmenter/constructor/constructor/options-throwing-getters.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/constructor/constructor/options-toobject-prototype.js b/js/src/tests/test262/intl402/Segmenter/constructor/constructor/options-toobject-prototype.js index 08a0379c6781..787642739a9f 100644 --- a/js/src/tests/test262/intl402/Segmenter/constructor/constructor/options-toobject-prototype.js +++ b/js/src/tests/test262/intl402/Segmenter/constructor/constructor/options-toobject-prototype.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -27,6 +27,7 @@ const optionsArguments = [ "test", 7, Symbol(), + {}, ]; for (const options of optionsArguments) { diff --git a/js/src/tests/test262/intl402/Segmenter/constructor/constructor/options-toobject.js b/js/src/tests/test262/intl402/Segmenter/constructor/constructor/options-toobject.js index 7ac58cdbc357..915e7be71798 100644 --- a/js/src/tests/test262/intl402/Segmenter/constructor/constructor/options-toobject.js +++ b/js/src/tests/test262/intl402/Segmenter/constructor/constructor/options-toobject.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -18,6 +18,7 @@ const optionsArguments = [ "test", 7, Symbol(), + {}, ]; for (const options of optionsArguments) { diff --git a/js/src/tests/test262/intl402/Segmenter/constructor/constructor/options-undefined.js b/js/src/tests/test262/intl402/Segmenter/constructor/constructor/options-undefined.js index 23057f363734..20a0a0452e19 100644 --- a/js/src/tests/test262/intl402/Segmenter/constructor/constructor/options-undefined.js +++ b/js/src/tests/test262/intl402/Segmenter/constructor/constructor/options-undefined.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/constructor/constructor/options-valid-combinations.js b/js/src/tests/test262/intl402/Segmenter/constructor/constructor/options-valid-combinations.js new file mode 100644 index 000000000000..1e9d9986cb92 --- /dev/null +++ b/js/src/tests/test262/intl402/Segmenter/constructor/constructor/options-valid-combinations.js @@ -0,0 +1,62 @@ +// |reftest| skip -- Intl.Segmenter is not supported +// Copyright 2018 the V8 project authors, Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-Intl.Segmenter +description: Checks handling of valid values for the granularity option to the Segmenter constructor. +info: | + Intl.Segmenter ([ locales [ , options ]]) + + 9. Let lineBreakStyle be ? GetOption(options, "lineBreakStyle", "string", « "strict", "normal", "loose" », "normal"). + 13. Let granularity be ? GetOption(options, "granularity", "string", « "grapheme", "word", "sentence", "line" », "grapheme"). + 14. Set segmenter.[[SegmenterGranularity]] to granularity. + 15. If granularity is "line", + a. Set segmenter.[[SegmenterLineBreakStyle]] to r.[[lb]]. +features: [Intl.Segmenter] +---*/ + +const lineBreakStyleOptions = ["strict", "normal", "loose"]; +const granularityOptions = ["grapheme", "word", "sentence", "line"]; +const combinations = []; + +combinations.push([ + {}, + "grapheme", + undefined, +]); + +for (const lineBreakStyle of lineBreakStyleOptions) { + combinations.push([ + { lineBreakStyle }, + "grapheme", + undefined, + ]); +} + +for (const granularity of granularityOptions) { + combinations.push([ + { granularity }, + granularity, + granularity === "line" ? "normal" : undefined, + ]); +} + +for (const lineBreakStyle of lineBreakStyleOptions) { + for (const granularity of granularityOptions) { + combinations.push([ + { granularity, lineBreakStyle }, + granularity, + granularity === "line" ? lineBreakStyle : undefined, + ]); + } +} + +for (const [input, granularity, lineBreakStyle] of combinations) { + const segmenter = new Intl.Segmenter([], input); + const resolvedOptions = segmenter.resolvedOptions(); + assert.sameValue(resolvedOptions.granularity, granularity); + assert.sameValue(resolvedOptions.lineBreakStyle, lineBreakStyle); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/Segmenter/constructor/constructor/subclassing.js b/js/src/tests/test262/intl402/Segmenter/constructor/constructor/subclassing.js index 0745cbcc5a47..447c9953d0c2 100644 --- a/js/src/tests/test262/intl402/Segmenter/constructor/constructor/subclassing.js +++ b/js/src/tests/test262/intl402/Segmenter/constructor/constructor/subclassing.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/constructor/length.js b/js/src/tests/test262/intl402/Segmenter/constructor/length.js index 94c9278be9c1..50e6a67e9e05 100644 --- a/js/src/tests/test262/intl402/Segmenter/constructor/length.js +++ b/js/src/tests/test262/intl402/Segmenter/constructor/length.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/constructor/name.js b/js/src/tests/test262/intl402/Segmenter/constructor/name.js index 4f57f4cf3ed2..b3c58e565812 100644 --- a/js/src/tests/test262/intl402/Segmenter/constructor/name.js +++ b/js/src/tests/test262/intl402/Segmenter/constructor/name.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/constructor/prop-desc.js b/js/src/tests/test262/intl402/Segmenter/constructor/prop-desc.js index 5c0285b67277..4e0e80b668ef 100644 --- a/js/src/tests/test262/intl402/Segmenter/constructor/prop-desc.js +++ b/js/src/tests/test262/intl402/Segmenter/constructor/prop-desc.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/constructor/prototype.js b/js/src/tests/test262/intl402/Segmenter/constructor/prototype.js index d3f2749eb033..6ee85262cf8f 100644 --- a/js/src/tests/test262/intl402/Segmenter/constructor/prototype.js +++ b/js/src/tests/test262/intl402/Segmenter/constructor/prototype.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/basic.js b/js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/basic.js index 903811cd9540..3cbe29059f5e 100644 --- a/js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/basic.js +++ b/js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/basic.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 Igalia S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/branding.js b/js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/branding.js index 23008e6ccd05..d5b5ac00d91c 100644 --- a/js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/branding.js +++ b/js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/branding.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -11,7 +11,10 @@ info: | features: [Intl.Segmenter] ---*/ -const fn = Intl.Segmenter.supportedLocalesOf; +const supportedLocalesOf = Intl.Segmenter.supportedLocalesOf; + +assert.sameValue(typeof supportedLocalesOf, "function"); + const thisValues = [ undefined, null, @@ -25,7 +28,7 @@ const thisValues = [ ]; for (const thisValue of thisValues) { - const result = fn.call(thisValue); + const result = supportedLocalesOf.call(thisValue); assert.sameValue(Array.isArray(result), true); } diff --git a/js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/length.js b/js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/length.js index 9f8b3736e5bb..8fc74436136e 100644 --- a/js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/length.js +++ b/js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/length.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/locales-empty.js b/js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/locales-empty.js new file mode 100644 index 000000000000..07c91b85aad6 --- /dev/null +++ b/js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/locales-empty.js @@ -0,0 +1,22 @@ +// |reftest| skip -- Intl.Segmenter is not supported +// Copyright 2018 the V8 project authors, Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-Intl.Segmenter.supportedLocalesOf +description: Checks handling of an empty locales argument to the supportedLocalesOf function. +info: | + Intl.Segmenter.supportedLocalesOf ( locales [, options ]) + + 3. Return ? SupportedLocales(availableLocales, requestedLocales, options). +includes: [compareArray.js] +features: [Intl.Segmenter] +---*/ + +assert.sameValue(typeof Intl.Segmenter.supportedLocalesOf, "function", + "Should support Intl.Segmenter.supportedLocalesOf."); + +assert.compareArray(Intl.Segmenter.supportedLocalesOf(), []); +assert.compareArray(Intl.Segmenter.supportedLocalesOf([]), []); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/locales-invalid.js b/js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/locales-invalid.js index 987b062c1a65..0524a4ee9231 100644 --- a/js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/locales-invalid.js +++ b/js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/locales-invalid.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/locales-specific.js b/js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/locales-specific.js new file mode 100644 index 000000000000..76ecdd9b9d18 --- /dev/null +++ b/js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/locales-specific.js @@ -0,0 +1,25 @@ +// |reftest| skip -- Intl.Segmenter is not supported +// Copyright 2018 the V8 project authors, Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-Intl.Segmenter.supportedLocalesOf +description: Checks handling of specific locales arguments to the supportedLocalesOf function. +info: | + Intl.Segmenter.supportedLocalesOf ( locales [, options ]) + + 3. Return ? SupportedLocales(availableLocales, requestedLocales, options). +includes: [compareArray.js] +locale: [sr, sr-Thai-RS, de, zh-CN] +features: [Intl.Segmenter] +---*/ + +assert.sameValue(typeof Intl.Segmenter.supportedLocalesOf, "function", + "Should support Intl.Segmenter.supportedLocalesOf."); + +assert.compareArray(Intl.Segmenter.supportedLocalesOf("sr"), ["sr"]); + +const multiLocale = ["sr-Thai-RS", "de", "zh-CN"]; +assert.compareArray(Intl.Segmenter.supportedLocalesOf(multiLocale), multiLocale); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/name.js b/js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/name.js index d34fd29b356a..8874465ed971 100644 --- a/js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/name.js +++ b/js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/name.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/options-localeMatcher-invalid.js b/js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/options-localeMatcher-invalid.js index 41e16712ed12..3ca3be44cb05 100644 --- a/js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/options-localeMatcher-invalid.js +++ b/js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/options-localeMatcher-invalid.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/options-null.js b/js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/options-null.js index 6ca5407265d8..6c851e1a21c8 100644 --- a/js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/options-null.js +++ b/js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/options-null.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/options-toobject.js b/js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/options-toobject.js index 35997ab67aee..54de8da4358e 100644 --- a/js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/options-toobject.js +++ b/js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/options-toobject.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/options-undefined.js b/js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/options-undefined.js index 4a459519e916..9d1c146cd4bf 100644 --- a/js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/options-undefined.js +++ b/js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/options-undefined.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/prop-desc.js b/js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/prop-desc.js index 7e82fd6e591d..734c1deeb03f 100644 --- a/js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/prop-desc.js +++ b/js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/prop-desc.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/result-type.js b/js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/result-type.js index 82043a0f0b08..77e9559f529a 100644 --- a/js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/result-type.js +++ b/js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/result-type.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/instance/extensibility.js b/js/src/tests/test262/intl402/Segmenter/instance/extensibility.js index 1682fb4f4c06..7a59993a6077 100644 --- a/js/src/tests/test262/intl402/Segmenter/instance/extensibility.js +++ b/js/src/tests/test262/intl402/Segmenter/instance/extensibility.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/instance/prototype.js b/js/src/tests/test262/intl402/Segmenter/instance/prototype.js index a0e1cc573a21..8feefa529990 100644 --- a/js/src/tests/test262/intl402/Segmenter/instance/prototype.js +++ b/js/src/tests/test262/intl402/Segmenter/instance/prototype.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/iterator/branding.js b/js/src/tests/test262/intl402/Segmenter/iterator/branding.js index e7d786d3c7b3..02ff9951f014 100644 --- a/js/src/tests/test262/intl402/Segmenter/iterator/branding.js +++ b/js/src/tests/test262/intl402/Segmenter/iterator/branding.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/iterator/breakType.js b/js/src/tests/test262/intl402/Segmenter/iterator/breakType.js index 69f3c05ab85f..a3779ebeadd5 100644 --- a/js/src/tests/test262/intl402/Segmenter/iterator/breakType.js +++ b/js/src/tests/test262/intl402/Segmenter/iterator/breakType.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/iterator/following.js b/js/src/tests/test262/intl402/Segmenter/iterator/following.js index 9a798a1bdc7d..12a1647a1507 100644 --- a/js/src/tests/test262/intl402/Segmenter/iterator/following.js +++ b/js/src/tests/test262/intl402/Segmenter/iterator/following.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -26,7 +26,7 @@ const tests = [ ]; for (const [input, position] of tests) { - assert.sameValue(iter.following(0 | input), false); + assert.sameValue(iter.following(input), false); assert.sameValue(iter.position, position, String(input)); } diff --git a/js/src/tests/test262/intl402/Segmenter/iterator/granularity.js b/js/src/tests/test262/intl402/Segmenter/iterator/granularity.js index c3484ad39c3a..2ddec7c36ce9 100644 --- a/js/src/tests/test262/intl402/Segmenter/iterator/granularity.js +++ b/js/src/tests/test262/intl402/Segmenter/iterator/granularity.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -15,11 +15,7 @@ for (const granularity of ["grapheme", "word", "sentence", "line"]) { assert.sameValue(typeof iter.position, "number"); assert.sameValue(iter.position, 0); - if (granularity === "grapheme") { - assert.sameValue(iter.breakType, undefined); - } else { - assert.sameValue(typeof iter.breakType, "string"); - } + assert.sameValue(iter.breakType, undefined); } reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/Segmenter/iterator/next.js b/js/src/tests/test262/intl402/Segmenter/iterator/next.js index 67f9cb8bc0f3..377b492e9e5e 100644 --- a/js/src/tests/test262/intl402/Segmenter/iterator/next.js +++ b/js/src/tests/test262/intl402/Segmenter/iterator/next.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/iterator/position.js b/js/src/tests/test262/intl402/Segmenter/iterator/position.js index 3966574960dc..60116fd65d16 100644 --- a/js/src/tests/test262/intl402/Segmenter/iterator/position.js +++ b/js/src/tests/test262/intl402/Segmenter/iterator/position.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/iterator/preceding.js b/js/src/tests/test262/intl402/Segmenter/iterator/preceding.js index e180e7a4e44d..b38077812c6c 100644 --- a/js/src/tests/test262/intl402/Segmenter/iterator/preceding.js +++ b/js/src/tests/test262/intl402/Segmenter/iterator/preceding.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -24,13 +24,12 @@ const tests = [ ]; for (const [input, position] of tests) { - assert.sameValue(iter.preceding(0 | input), false); + assert.sameValue(iter.preceding(input), false); assert.sameValue(iter.position, position, String(input)); } assert.throws(RangeError, () => iter.preceding("ABC")); assert.throws(RangeError, () => iter.preceding(null)); -assert.throws(RangeError, () => iter.preceding(1.4)); assert.throws(RangeError, () => iter.preceding(-3)); // 1.5.3.3 %SegmentIteratorPrototype%.preceding( [ from ] ) diff --git a/js/src/tests/test262/intl402/Segmenter/iterator/prototype.js b/js/src/tests/test262/intl402/Segmenter/iterator/prototype.js index 8b3f8a3c35aa..bdd9600afbd0 100644 --- a/js/src/tests/test262/intl402/Segmenter/iterator/prototype.js +++ b/js/src/tests/test262/intl402/Segmenter/iterator/prototype.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/prototype/constructor/prop-desc.js b/js/src/tests/test262/intl402/Segmenter/prototype/constructor/prop-desc.js index 9a400b2bed88..4ce1dbdefb65 100644 --- a/js/src/tests/test262/intl402/Segmenter/prototype/constructor/prop-desc.js +++ b/js/src/tests/test262/intl402/Segmenter/prototype/constructor/prop-desc.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/prototype/prop-desc.js b/js/src/tests/test262/intl402/Segmenter/prototype/prop-desc.js index 2979e30746c8..349184aef3b5 100644 --- a/js/src/tests/test262/intl402/Segmenter/prototype/prop-desc.js +++ b/js/src/tests/test262/intl402/Segmenter/prototype/prop-desc.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/prototype/resolvedOptions/branding.js b/js/src/tests/test262/intl402/Segmenter/prototype/resolvedOptions/branding.js index ef4b65936890..8393838ec9c4 100644 --- a/js/src/tests/test262/intl402/Segmenter/prototype/resolvedOptions/branding.js +++ b/js/src/tests/test262/intl402/Segmenter/prototype/resolvedOptions/branding.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -12,16 +12,18 @@ info: | features: [Intl.Segmenter] ---*/ -const fn = Intl.Segmenter.prototype.resolvedOptions; +const resolvedOptions = Intl.Segmenter.prototype.resolvedOptions; -assert.throws(TypeError, () => fn.call(undefined), "undefined"); -assert.throws(TypeError, () => fn.call(null), "null"); -assert.throws(TypeError, () => fn.call(true), "true"); -assert.throws(TypeError, () => fn.call(""), "empty string"); -assert.throws(TypeError, () => fn.call(Symbol()), "symbol"); -assert.throws(TypeError, () => fn.call(1), "1"); -assert.throws(TypeError, () => fn.call({}), "plain object"); -assert.throws(TypeError, () => fn.call(Intl.Segmenter), "Intl.Segmenter"); -assert.throws(TypeError, () => fn.call(Intl.Segmenter.prototype), "Intl.Segmenter.prototype"); +assert.sameValue(typeof resolvedOptions, "function"); + +assert.throws(TypeError, () => resolvedOptions.call(undefined), "undefined"); +assert.throws(TypeError, () => resolvedOptions.call(null), "null"); +assert.throws(TypeError, () => resolvedOptions.call(true), "true"); +assert.throws(TypeError, () => resolvedOptions.call(""), "empty string"); +assert.throws(TypeError, () => resolvedOptions.call(Symbol()), "symbol"); +assert.throws(TypeError, () => resolvedOptions.call(1), "1"); +assert.throws(TypeError, () => resolvedOptions.call({}), "plain object"); +assert.throws(TypeError, () => resolvedOptions.call(Intl.Segmenter), "Intl.Segmenter"); +assert.throws(TypeError, () => resolvedOptions.call(Intl.Segmenter.prototype), "Intl.Segmenter.prototype"); reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/Segmenter/prototype/resolvedOptions/caching.js b/js/src/tests/test262/intl402/Segmenter/prototype/resolvedOptions/caching.js index f5115a824c8f..1dca8c00e93d 100644 --- a/js/src/tests/test262/intl402/Segmenter/prototype/resolvedOptions/caching.js +++ b/js/src/tests/test262/intl402/Segmenter/prototype/resolvedOptions/caching.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/prototype/resolvedOptions/length.js b/js/src/tests/test262/intl402/Segmenter/prototype/resolvedOptions/length.js index a45864c8f611..99646b36bcdc 100644 --- a/js/src/tests/test262/intl402/Segmenter/prototype/resolvedOptions/length.js +++ b/js/src/tests/test262/intl402/Segmenter/prototype/resolvedOptions/length.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/prototype/resolvedOptions/name.js b/js/src/tests/test262/intl402/Segmenter/prototype/resolvedOptions/name.js index da293986fef6..eba2a52a3f8d 100644 --- a/js/src/tests/test262/intl402/Segmenter/prototype/resolvedOptions/name.js +++ b/js/src/tests/test262/intl402/Segmenter/prototype/resolvedOptions/name.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/prototype/resolvedOptions/order.js b/js/src/tests/test262/intl402/Segmenter/prototype/resolvedOptions/order.js index a3d6cb638062..c92a044c9a50 100644 --- a/js/src/tests/test262/intl402/Segmenter/prototype/resolvedOptions/order.js +++ b/js/src/tests/test262/intl402/Segmenter/prototype/resolvedOptions/order.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/prototype/resolvedOptions/prop-desc.js b/js/src/tests/test262/intl402/Segmenter/prototype/resolvedOptions/prop-desc.js index 185d97940ffc..6bbecd0ebe4a 100644 --- a/js/src/tests/test262/intl402/Segmenter/prototype/resolvedOptions/prop-desc.js +++ b/js/src/tests/test262/intl402/Segmenter/prototype/resolvedOptions/prop-desc.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/prototype/resolvedOptions/type-with-lbs.js b/js/src/tests/test262/intl402/Segmenter/prototype/resolvedOptions/type-with-lbs.js index b26698c3c703..6900695231b4 100644 --- a/js/src/tests/test262/intl402/Segmenter/prototype/resolvedOptions/type-with-lbs.js +++ b/js/src/tests/test262/intl402/Segmenter/prototype/resolvedOptions/type-with-lbs.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/prototype/resolvedOptions/type-without-lbs.js b/js/src/tests/test262/intl402/Segmenter/prototype/resolvedOptions/type-without-lbs.js index 7cbcc4f20193..76c1cb4df891 100644 --- a/js/src/tests/test262/intl402/Segmenter/prototype/resolvedOptions/type-without-lbs.js +++ b/js/src/tests/test262/intl402/Segmenter/prototype/resolvedOptions/type-without-lbs.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/prototype/segment/branding.js b/js/src/tests/test262/intl402/Segmenter/prototype/segment/branding.js index 752fd0cc9d76..35d1b79ab7ef 100644 --- a/js/src/tests/test262/intl402/Segmenter/prototype/segment/branding.js +++ b/js/src/tests/test262/intl402/Segmenter/prototype/segment/branding.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -12,16 +12,18 @@ info: | features: [Intl.Segmenter] ---*/ -const fn = Intl.Segmenter.prototype.segment; +const segment = Intl.Segmenter.prototype.segment; -assert.throws(TypeError, () => fn.call(undefined), "undefined"); -assert.throws(TypeError, () => fn.call(null), "null"); -assert.throws(TypeError, () => fn.call(true), "true"); -assert.throws(TypeError, () => fn.call(""), "empty string"); -assert.throws(TypeError, () => fn.call(Symbol()), "symbol"); -assert.throws(TypeError, () => fn.call(1), "1"); -assert.throws(TypeError, () => fn.call({}), "plain object"); -assert.throws(TypeError, () => fn.call(Intl.Segmenter), "Intl.Segmenter"); -assert.throws(TypeError, () => fn.call(Intl.Segmenter.prototype), "Intl.Segmenter.prototype"); +assert.sameValue(typeof segment, "function"); + +assert.throws(TypeError, () => segment.call(undefined), "undefined"); +assert.throws(TypeError, () => segment.call(null), "null"); +assert.throws(TypeError, () => segment.call(true), "true"); +assert.throws(TypeError, () => segment.call(""), "empty string"); +assert.throws(TypeError, () => segment.call(Symbol()), "symbol"); +assert.throws(TypeError, () => segment.call(1), "1"); +assert.throws(TypeError, () => segment.call({}), "plain object"); +assert.throws(TypeError, () => segment.call(Intl.Segmenter), "Intl.Segmenter"); +assert.throws(TypeError, () => segment.call(Intl.Segmenter.prototype), "Intl.Segmenter.prototype"); reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/Segmenter/prototype/segment/length.js b/js/src/tests/test262/intl402/Segmenter/prototype/segment/length.js index 973a6cefbc26..a8b870ae88a1 100644 --- a/js/src/tests/test262/intl402/Segmenter/prototype/segment/length.js +++ b/js/src/tests/test262/intl402/Segmenter/prototype/segment/length.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/prototype/segment/name.js b/js/src/tests/test262/intl402/Segmenter/prototype/segment/name.js index 939fda7219dd..5bada44a9391 100644 --- a/js/src/tests/test262/intl402/Segmenter/prototype/segment/name.js +++ b/js/src/tests/test262/intl402/Segmenter/prototype/segment/name.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/prototype/segment/prop-desc.js b/js/src/tests/test262/intl402/Segmenter/prototype/segment/prop-desc.js index 4586adff059c..5b5252b906ad 100644 --- a/js/src/tests/test262/intl402/Segmenter/prototype/segment/prop-desc.js +++ b/js/src/tests/test262/intl402/Segmenter/prototype/segment/prop-desc.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-grapheme-following.js b/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-grapheme-following.js index 91e45e81376d..192655ae7fe4 100644 --- a/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-grapheme-following.js +++ b/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-grapheme-following.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-grapheme-iterable.js b/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-grapheme-iterable.js index 0e8740b5eb83..3ef88bafc1d4 100644 --- a/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-grapheme-iterable.js +++ b/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-grapheme-iterable.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-grapheme-next.js b/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-grapheme-next.js index 8795bd217483..5a6a4ac64a61 100644 --- a/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-grapheme-next.js +++ b/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-grapheme-next.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -31,12 +31,16 @@ for (const text of [ ]) { const iter = seg.segment(text); let segments = []; + let oldPos = -1; for (let result = iter.next(); !result.done; result = iter.next()) { const v = result.value; assert.sameValue(undefined, v.breakType); assert.sameValue("string", typeof v.segment); assert(v.segment.length > 0); segments.push(v.segment); + assert.sameValue(typeof v.position, "number"); + assert(oldPos < v.position); + oldPos = v.position; } assert.sameValue(text, segments.join('')); } diff --git a/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-grapheme-preceding.js b/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-grapheme-preceding.js index 2d1b4120acb2..d86582ac03a7 100644 --- a/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-grapheme-preceding.js +++ b/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-grapheme-preceding.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-grapheme.js b/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-grapheme.js index 615e29cf7ea8..82226659a0f3 100644 --- a/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-grapheme.js +++ b/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-grapheme.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-line-following-modes.js b/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-line-following-modes.js index 863f025c08e1..9652a17ce6b5 100644 --- a/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-line-following-modes.js +++ b/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-line-following-modes.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-line-following.js b/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-line-following.js index 799911e34b8d..00dedea34d28 100644 --- a/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-line-following.js +++ b/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-line-following.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-line-iterable.js b/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-line-iterable.js index 1b6bdf18c97b..ca49fe8da186 100644 --- a/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-line-iterable.js +++ b/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-line-iterable.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-line-next.js b/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-line-next.js index 9c066c81993d..11eba6c8d2ad 100644 --- a/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-line-next.js +++ b/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-line-next.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -31,14 +31,18 @@ for (const text of [ ]) { const iter = seg.segment(text); let segments = []; + let oldPos = -1; for (let result = iter.next(); !result.done; result = iter.next()) { const v = result.value; assert(["soft", "hard"].includes(iter.breakType), iter.breakType); assert.sameValue("string", typeof v.segment); assert(v.segment.length > 0); segments.push(v.segment); - } - assert.sameValue(text, segments.join('')); + assert.sameValue(typeof v.position, "number"); + assert(oldPos < v.position); + oldPos = v.position; + } + assert.sameValue(text, segments.join('')); } reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-line-preceding.js b/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-line-preceding.js index 439c851cf802..4b68f8452651 100644 --- a/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-line-preceding.js +++ b/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-line-preceding.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-line.js b/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-line.js index 719d7cbb94f1..a5dd35910a2f 100644 --- a/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-line.js +++ b/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-line.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -30,7 +30,7 @@ for (const text of [ "법원 “다스 지분 처분권·수익권 모두 MB가 보유”", // Korean ]) { const iter = seg.segment(text); - assert(["soft", "hard"].includes(iter.breakType), iter.breakType); + assert.sameValue(undefined, iter.breakType); assert.sameValue(0, iter.position); } diff --git a/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-sentence-following.js b/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-sentence-following.js index e8a47fe41c59..f9d384430ad1 100644 --- a/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-sentence-following.js +++ b/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-sentence-following.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-sentence-iterable.js b/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-sentence-iterable.js index 7fe4ad93c678..457bf66856e6 100644 --- a/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-sentence-iterable.js +++ b/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-sentence-iterable.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-sentence-next.js b/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-sentence-next.js index 9db99ceabac7..39d5f93f3720 100644 --- a/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-sentence-next.js +++ b/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-sentence-next.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -31,12 +31,16 @@ for (const text of [ ]) { const iter = seg.segment(text); let segments = []; + let oldPos = -1; for (let result = iter.next(); !result.done; result = iter.next()) { const v = result.value; assert(["sep", "term"].includes(iter.breakType), iter.breakType); assert.sameValue("string", typeof v.segment); assert(v.segment.length > 0); segments.push(v.segment); + assert.sameValue(typeof v.position, "number"); + assert(oldPos < v.position); + oldPos = v.position; } assert.sameValue(text, segments.join('')); } diff --git a/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-sentence-preceding.js b/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-sentence-preceding.js index b4a62baeb690..4d9bbff4386d 100644 --- a/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-sentence-preceding.js +++ b/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-sentence-preceding.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-sentence.js b/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-sentence.js index dfbd26956fd7..43bdc9106a1b 100644 --- a/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-sentence.js +++ b/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-sentence.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -30,7 +30,7 @@ for (const text of [ "법원 “다스 지분 처분권·수익권 모두 MB가 보유”", // Korean ]) { const iter = seg.segment(text); - assert(["sep", "term"].includes(iter.breakType), iter.breakType); + assert.sameValue(undefined, iter.breakType); assert.sameValue(0, iter.position); } diff --git a/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-tostring.js b/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-tostring.js new file mode 100644 index 000000000000..1790793b3d49 --- /dev/null +++ b/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-tostring.js @@ -0,0 +1,39 @@ +// |reftest| skip -- Intl.Segmenter is not supported +// Copyright 2018 the V8 project authors, Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-Intl.Segmenter.prototype.segment +description: Verifies the string coercion in the "segment" function of the Segmenter prototype object. +info: | + Intl.Segmenter.prototype.segment( string ) + + 3. Let string be ? ToString(string). +features: [Intl.Segmenter] +---*/ + +const tests = [ + [[], "undefined"], + [[undefined], "undefined"], + [[null], "null"], + [[true], "true"], + [[false], "false"], + [[12], "12"], + [[1.23], "1.23"], + [[["a", "b"]], "a"], + [[{}], "["], // "[object Object]" +]; + +const segmenter = new Intl.Segmenter("en", { "granularity": "word" }); +for (const [args, expected] of tests) { + const iterator = segmenter.segment(...args); + const result = iterator.next().value; + assert.sameValue(result.segment, expected, `Expected segment "${expected}", found "${result.segment}" for arguments ${args}`); + assert(["word", "none"].includes(result.breakType), `Expected valid breakType, found "${result.breakType}" for arguments ${args}`); + assert.sameValue(result.position, expected.length, `Expected position ${expected.length}, found ${result.position} for arguments ${args}`); +} + +const symbol = Symbol(); +assert.throws(TypeError, () => segmenter.segment(symbol)); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-word-following.js b/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-word-following.js index bd3cca707dca..e1b055c15c1b 100644 --- a/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-word-following.js +++ b/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-word-following.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-word-iterable.js b/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-word-iterable.js index 93ce203a692e..da5696417aee 100644 --- a/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-word-iterable.js +++ b/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-word-iterable.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-word-next.js b/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-word-next.js index f5c9bf88c8df..5ac7ad1f837f 100644 --- a/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-word-next.js +++ b/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-word-next.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -31,12 +31,16 @@ for (const text of [ ]) { const iter = seg.segment(text); let segments = []; + let oldPos = -1; for (let result = iter.next(); !result.done; result = iter.next()) { const v = result.value; assert(["word", "none"].includes(iter.breakType), iter.breakType); assert.sameValue("string", typeof v.segment); assert(v.segment.length > 0); segments.push(v.segment); + assert.sameValue(typeof v.position, "number"); + assert(oldPos < v.position); + oldPos = v.position; } assert.sameValue(text, segments.join('')); } diff --git a/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-word-preceding.js b/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-word-preceding.js index c1fddd3692e0..d2c18de819b2 100644 --- a/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-word-preceding.js +++ b/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-word-preceding.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-word.js b/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-word.js index 92afe7142317..8c9ec7bca998 100644 --- a/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-word.js +++ b/js/src/tests/test262/intl402/Segmenter/prototype/segment/segment-word.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. @@ -30,7 +30,7 @@ for (const text of [ "법원 “다스 지분 처분권·수익권 모두 MB가 보유”", // Korean ]) { const iter = seg.segment(text); - assert(["word", "none"].includes(iter.breakType), iter.breakType); + assert.sameValue(undefined, iter.breakType); assert.sameValue(0, iter.position); } diff --git a/js/src/tests/test262/intl402/Segmenter/prototype/toStringTag/toString.js b/js/src/tests/test262/intl402/Segmenter/prototype/toStringTag/toString.js index d039d6c802f9..a0b251f80ffc 100644 --- a/js/src/tests/test262/intl402/Segmenter/prototype/toStringTag/toString.js +++ b/js/src/tests/test262/intl402/Segmenter/prototype/toStringTag/toString.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/intl402/Segmenter/prototype/toStringTag/toStringTag.js b/js/src/tests/test262/intl402/Segmenter/prototype/toStringTag/toStringTag.js index 77ef92e49bdd..d3053866c5b2 100644 --- a/js/src/tests/test262/intl402/Segmenter/prototype/toStringTag/toStringTag.js +++ b/js/src/tests/test262/intl402/Segmenter/prototype/toStringTag/toStringTag.js @@ -1,4 +1,4 @@ -// |reftest| skip-if(!Intl.hasOwnProperty('Segmenter')) -- Intl.Segmenter is not enabled unconditionally +// |reftest| skip -- Intl.Segmenter is not supported // Copyright 2018 Igalia, S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/js/src/tests/test262/language/expressions/class/private-methods/browser.js b/js/src/tests/test262/language/expressions/class/private-methods/browser.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test262/language/expressions/class/private-methods/prod-private-async-generator.js b/js/src/tests/test262/language/expressions/class/private-methods/prod-private-async-generator.js new file mode 100644 index 000000000000..7dd499e2dbbf --- /dev/null +++ b/js/src/tests/test262/language/expressions/class/private-methods/prod-private-async-generator.js @@ -0,0 +1,135 @@ +// |reftest| skip -- class-methods-private is not supported +// This file was procedurally generated from the following sources: +// - src/class-elements/prod-private-async-generator.case +// - src/class-elements/private-methods/cls-expr.template +/*--- +description: Private Async Generator (private method definitions in a class expression) +esid: prod-MethodDefinition +features: [async-iteration, class, class-methods-private] +flags: [generated, async] +info: | + ClassElement : + MethodDefinition + ... + ; + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + GeneratorMethod + AsyncMethod + AsyncGeneratorMethod + get ClassElementName () { FunctionBody } + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){GeneratorBody} + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ) { AsyncFunctionBody } + + AsyncGeneratorMethod : + async [no LineTerminator here]* ClassElementName ( UniqueFormalParameters ) { AsyncGeneratorBody } + + --- + + InitializeClassElements ( F, proto ) + + ... + 5. For each item element in order from elements, + a. Assert: If element.[[Placement]] is "prototype" or "static", then element.[[Key]] is not a Private Name. + b. If element.[[Kind]] is "method" and element.[[Placement]] is "static" or "prototype", + i. Let receiver be F if element.[[Placement]] is "static", else let receiver be proto. + ii. Perform ? DefineClassElement(receiver, element). + + InitializeInstanceElements ( O, constructor ) + + ... + 3. Let elements be the value of F's [[Elements]] internal slot. + 4. For each item element in order from elements, + a. If element.[[Placement]] is "own" and element.[[Kind]] is "method", + i. Perform ? DefineClassElement(O, element). + + DefineClassElement (receiver, element) + + ... + 6. If key is a Private Name, + a. Perform ? PrivateFieldDefine(receiver, key, descriptor). + + PrivateFieldDefine (P, O, desc) + + ... + 6. Append { [[PrivateName]]: P, [[PrivateFieldDescriptor]]: desc } to O.[[PrivateFieldDescriptors]]. + +---*/ +var ctorPromise; + + + +/*** + * template notes: + * 1. method should always be #m + * 2. the template provides c.ref/other.ref for external reference + */ + +function hasProp(obj, name, expected, msg) { + var hasOwnProperty = Object.prototype.hasOwnProperty.call(obj, name); + assert.sameValue(hasOwnProperty, expected, msg); + + var hasProperty = Reflect.has(obj, name); + assert.sameValue(hasProperty, expected, msg); +} + +var C = class { + async * #m() { return 42; } + + + get ref() { return this.#m; } + + constructor() { + hasProp(this, '#m', false, 'private methods are defined in an special internal slot and cannot be found as own properties'); + assert.sameValue(typeof this.#m, 'function'); + assert.sameValue(this.ref, this.#m, 'returns the same value'); + assert.sameValue(this.#m, (() => this)().#m, 'memberexpression and call expression forms'); + + var ctorIter = this.#m(); + var p = ctorIter.next(); + ctorPromise = p.then(({ value, done }) => { + assert.sameValue(value, 42, 'return from generator method, inside ctor'); + assert.sameValue(done, true, 'iterator is done, inside ctor'); + }, $DONE); + assert.sameValue(this.#m.name, '#m', 'function name inside constructor'); + + } +} + +var c = new C(); +var other = new C(); + +hasProp(C.prototype, '#m', false, 'method is not defined in the prototype'); +hasProp(C, '#m', false, 'method is not defined in the contructor'); +hasProp(c, '#m', false, 'method cannot be seen outside of the class'); + +/*** + * MethodDefinition : ClassElementName ( UniqueFormalParameters ) { FunctionBody } + * + * 1. Let methodDef be DefineMethod of MethodDefinition with argument homeObject. + * ... + */ +assert.sameValue(c.ref, other.ref, 'The method is defined once, and reused on every new instance'); + +assert.sameValue(c.ref.name, '#m', 'function name is preserved external reference'); +ctorPromise.then(() => { + // gets the returned async iterator from #m + var iter = c.ref(); + return iter.next().then(({ value, done }) => { + assert.sameValue(value, 42, 'return from generator method'); + assert.sameValue(done, true, 'iterator is done'); + }); +}, $DONE).then($DONE, $DONE); diff --git a/js/src/tests/test262/language/expressions/class/private-methods/prod-private-async-method.js b/js/src/tests/test262/language/expressions/class/private-methods/prod-private-async-method.js new file mode 100644 index 000000000000..ad847b20738b --- /dev/null +++ b/js/src/tests/test262/language/expressions/class/private-methods/prod-private-async-method.js @@ -0,0 +1,130 @@ +// |reftest| skip -- class-methods-private is not supported +// This file was procedurally generated from the following sources: +// - src/class-elements/prod-private-async-method.case +// - src/class-elements/private-methods/cls-expr.template +/*--- +description: Private Async Method (private method definitions in a class expression) +esid: prod-MethodDefinition +features: [async-functions, class, class-methods-private] +flags: [generated, async] +info: | + ClassElement : + MethodDefinition + ... + ; + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + GeneratorMethod + AsyncMethod + AsyncGeneratorMethod + get ClassElementName () { FunctionBody } + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){GeneratorBody} + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ) { AsyncFunctionBody } + + AsyncGeneratorMethod : + async [no LineTerminator here]* ClassElementName ( UniqueFormalParameters ) { AsyncGeneratorBody } + + --- + + InitializeClassElements ( F, proto ) + + ... + 5. For each item element in order from elements, + a. Assert: If element.[[Placement]] is "prototype" or "static", then element.[[Key]] is not a Private Name. + b. If element.[[Kind]] is "method" and element.[[Placement]] is "static" or "prototype", + i. Let receiver be F if element.[[Placement]] is "static", else let receiver be proto. + ii. Perform ? DefineClassElement(receiver, element). + + InitializeInstanceElements ( O, constructor ) + + ... + 3. Let elements be the value of F's [[Elements]] internal slot. + 4. For each item element in order from elements, + a. If element.[[Placement]] is "own" and element.[[Kind]] is "method", + i. Perform ? DefineClassElement(O, element). + + DefineClassElement (receiver, element) + + ... + 6. If key is a Private Name, + a. Perform ? PrivateFieldDefine(receiver, key, descriptor). + + PrivateFieldDefine (P, O, desc) + + ... + 6. Append { [[PrivateName]]: P, [[PrivateFieldDescriptor]]: desc } to O.[[PrivateFieldDescriptors]]. + +---*/ +var ctorPromise; + + + +/*** + * template notes: + * 1. method should always be #m + * 2. the template provides c.ref/other.ref for external reference + */ + +function hasProp(obj, name, expected, msg) { + var hasOwnProperty = Object.prototype.hasOwnProperty.call(obj, name); + assert.sameValue(hasOwnProperty, expected, msg); + + var hasProperty = Reflect.has(obj, name); + assert.sameValue(hasProperty, expected, msg); +} + +var C = class { + async #m() { return 42; } + + + get ref() { return this.#m; } + + constructor() { + hasProp(this, '#m', false, 'private methods are defined in an special internal slot and cannot be found as own properties'); + assert.sameValue(typeof this.#m, 'function'); + assert.sameValue(this.ref, this.#m, 'returns the same value'); + assert.sameValue(this.#m, (() => this)().#m, 'memberexpression and call expression forms'); + + assert.sameValue(this.#m.name, '#m', 'function name inside constructor'); + ctorPromise = this.#m().then(value => { + assert.sameValue(value, 42, 'already defined in the ctor'); + }, $DONE); + + } +} + +var c = new C(); +var other = new C(); + +hasProp(C.prototype, '#m', false, 'method is not defined in the prototype'); +hasProp(C, '#m', false, 'method is not defined in the contructor'); +hasProp(c, '#m', false, 'method cannot be seen outside of the class'); + +/*** + * MethodDefinition : ClassElementName ( UniqueFormalParameters ) { FunctionBody } + * + * 1. Let methodDef be DefineMethod of MethodDefinition with argument homeObject. + * ... + */ +assert.sameValue(c.ref, other.ref, 'The method is defined once, and reused on every new instance'); + +assert.sameValue(c.ref.name, '#m', 'function name is preserved external reference'); +ctorPromise.then(() => { + // gets the returned promise from #m + return c.ref().then(value => { + assert.sameValue(value, 42, 'function return'); + }); +}, $DONE).then($DONE, $DONE); diff --git a/js/src/tests/test262/language/expressions/class/private-methods/prod-private-generator.js b/js/src/tests/test262/language/expressions/class/private-methods/prod-private-generator.js new file mode 100644 index 000000000000..f650ca7ab853 --- /dev/null +++ b/js/src/tests/test262/language/expressions/class/private-methods/prod-private-generator.js @@ -0,0 +1,128 @@ +// |reftest| skip -- class-methods-private is not supported +// This file was procedurally generated from the following sources: +// - src/class-elements/prod-private-generator.case +// - src/class-elements/private-methods/cls-expr.template +/*--- +description: Private Generator (private method definitions in a class expression) +esid: prod-MethodDefinition +features: [generators, class, class-methods-private] +flags: [generated] +info: | + ClassElement : + MethodDefinition + ... + ; + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + GeneratorMethod + AsyncMethod + AsyncGeneratorMethod + get ClassElementName () { FunctionBody } + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){GeneratorBody} + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ) { AsyncFunctionBody } + + AsyncGeneratorMethod : + async [no LineTerminator here]* ClassElementName ( UniqueFormalParameters ) { AsyncGeneratorBody } + + --- + + InitializeClassElements ( F, proto ) + + ... + 5. For each item element in order from elements, + a. Assert: If element.[[Placement]] is "prototype" or "static", then element.[[Key]] is not a Private Name. + b. If element.[[Kind]] is "method" and element.[[Placement]] is "static" or "prototype", + i. Let receiver be F if element.[[Placement]] is "static", else let receiver be proto. + ii. Perform ? DefineClassElement(receiver, element). + + InitializeInstanceElements ( O, constructor ) + + ... + 3. Let elements be the value of F's [[Elements]] internal slot. + 4. For each item element in order from elements, + a. If element.[[Placement]] is "own" and element.[[Kind]] is "method", + i. Perform ? DefineClassElement(O, element). + + DefineClassElement (receiver, element) + + ... + 6. If key is a Private Name, + a. Perform ? PrivateFieldDefine(receiver, key, descriptor). + + PrivateFieldDefine (P, O, desc) + + ... + 6. Append { [[PrivateName]]: P, [[PrivateFieldDescriptor]]: desc } to O.[[PrivateFieldDescriptors]]. + +---*/ + + +/*** + * template notes: + * 1. method should always be #m + * 2. the template provides c.ref/other.ref for external reference + */ + +function hasProp(obj, name, expected, msg) { + var hasOwnProperty = Object.prototype.hasOwnProperty.call(obj, name); + assert.sameValue(hasOwnProperty, expected, msg); + + var hasProperty = Reflect.has(obj, name); + assert.sameValue(hasProperty, expected, msg); +} + +var C = class { + * #m() { return 42; } + + + get ref() { return this.#m; } + + constructor() { + hasProp(this, '#m', false, 'private methods are defined in an special internal slot and cannot be found as own properties'); + assert.sameValue(typeof this.#m, 'function'); + assert.sameValue(this.ref, this.#m, 'returns the same value'); + assert.sameValue(this.#m, (() => this)().#m, 'memberexpression and call expression forms'); + + var res = this.#m().next(); + assert.sameValue(res.value, 42, 'return from generator method, inside ctor'); + assert.sameValue(res.done, true, 'iterator is done, inside ctor'); + assert.sameValue(this.#m.name, '#m', 'function name inside constructor'); + + } +} + +var c = new C(); +var other = new C(); + +hasProp(C.prototype, '#m', false, 'method is not defined in the prototype'); +hasProp(C, '#m', false, 'method is not defined in the contructor'); +hasProp(c, '#m', false, 'method cannot be seen outside of the class'); + +/*** + * MethodDefinition : ClassElementName ( UniqueFormalParameters ) { FunctionBody } + * + * 1. Let methodDef be DefineMethod of MethodDefinition with argument homeObject. + * ... + */ +assert.sameValue(c.ref, other.ref, 'The method is defined once, and reused on every new instance'); + +// gets the returned iterator from #m +var res = c.ref().next(); +assert.sameValue(res.value, 42, 'return from generator method'); +assert.sameValue(res.done, true, 'iterator is done'); +assert.sameValue(c.ref.name, '#m', 'function name is preserved external reference'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/expressions/class/private-methods/prod-private-method.js b/js/src/tests/test262/language/expressions/class/private-methods/prod-private-method.js new file mode 100644 index 000000000000..725339a0217d --- /dev/null +++ b/js/src/tests/test262/language/expressions/class/private-methods/prod-private-method.js @@ -0,0 +1,124 @@ +// |reftest| skip -- class-methods-private is not supported +// This file was procedurally generated from the following sources: +// - src/class-elements/prod-private-method.case +// - src/class-elements/private-methods/cls-expr.template +/*--- +description: Private Method (private method definitions in a class expression) +esid: prod-MethodDefinition +features: [class, class-methods-private] +flags: [generated] +info: | + ClassElement : + MethodDefinition + ... + ; + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + GeneratorMethod + AsyncMethod + AsyncGeneratorMethod + get ClassElementName () { FunctionBody } + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){GeneratorBody} + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ) { AsyncFunctionBody } + + AsyncGeneratorMethod : + async [no LineTerminator here]* ClassElementName ( UniqueFormalParameters ) { AsyncGeneratorBody } + + --- + + InitializeClassElements ( F, proto ) + + ... + 5. For each item element in order from elements, + a. Assert: If element.[[Placement]] is "prototype" or "static", then element.[[Key]] is not a Private Name. + b. If element.[[Kind]] is "method" and element.[[Placement]] is "static" or "prototype", + i. Let receiver be F if element.[[Placement]] is "static", else let receiver be proto. + ii. Perform ? DefineClassElement(receiver, element). + + InitializeInstanceElements ( O, constructor ) + + ... + 3. Let elements be the value of F's [[Elements]] internal slot. + 4. For each item element in order from elements, + a. If element.[[Placement]] is "own" and element.[[Kind]] is "method", + i. Perform ? DefineClassElement(O, element). + + DefineClassElement (receiver, element) + + ... + 6. If key is a Private Name, + a. Perform ? PrivateFieldDefine(receiver, key, descriptor). + + PrivateFieldDefine (P, O, desc) + + ... + 6. Append { [[PrivateName]]: P, [[PrivateFieldDescriptor]]: desc } to O.[[PrivateFieldDescriptors]]. + +---*/ + + +/*** + * template notes: + * 1. method should always be #m + * 2. the template provides c.ref/other.ref for external reference + */ + +function hasProp(obj, name, expected, msg) { + var hasOwnProperty = Object.prototype.hasOwnProperty.call(obj, name); + assert.sameValue(hasOwnProperty, expected, msg); + + var hasProperty = Reflect.has(obj, name); + assert.sameValue(hasProperty, expected, msg); +} + +var C = class { + #m() { return 42; } + + + get ref() { return this.#m; } + + constructor() { + hasProp(this, '#m', false, 'private methods are defined in an special internal slot and cannot be found as own properties'); + assert.sameValue(typeof this.#m, 'function'); + assert.sameValue(this.ref, this.#m, 'returns the same value'); + assert.sameValue(this.#m, (() => this)().#m, 'memberexpression and call expression forms'); + + assert.sameValue(this.#m(), 42, 'already defined in the ctor'); + assert.sameValue(this.#m.name, '#m', 'function name inside constructor'); + + } +} + +var c = new C(); +var other = new C(); + +hasProp(C.prototype, '#m', false, 'method is not defined in the prototype'); +hasProp(C, '#m', false, 'method is not defined in the contructor'); +hasProp(c, '#m', false, 'method cannot be seen outside of the class'); + +/*** + * MethodDefinition : ClassElementName ( UniqueFormalParameters ) { FunctionBody } + * + * 1. Let methodDef be DefineMethod of MethodDefinition with argument homeObject. + * ... + */ +assert.sameValue(c.ref, other.ref, 'The method is defined once, and reused on every new instance'); + +// gets the returned value from #m +assert.sameValue(c.ref(), 42, 'function return'); +assert.sameValue(c.ref.name, '#m', 'function name is preserved external reference'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/expressions/class/private-methods/shell.js b/js/src/tests/test262/language/expressions/class/private-methods/shell.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test262/language/expressions/class/syntax/early-errors/private-async-generator-cannot-escape-token.js b/js/src/tests/test262/language/expressions/class/syntax/early-errors/private-async-generator-cannot-escape-token.js new file mode 100644 index 000000000000..7d056834ae3f --- /dev/null +++ b/js/src/tests/test262/language/expressions/class/syntax/early-errors/private-async-generator-cannot-escape-token.js @@ -0,0 +1,26 @@ +// |reftest| skip error:SyntaxError -- class-methods-private is not supported +// This file was procedurally generated from the following sources: +// - src/class-elements/private-async-generator-cannot-escape-token.case +// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template +/*--- +description: The pound signal in the private async generator cannot be escaped (class expression) +esid: prod-ClassElement +features: [class-methods-private, async-iteration, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + PrivateName:: + # IdentifierName + + U+0023 is the escape sequence for # + +---*/ + + +$DONOTEVALUATE(); + +var C = class { + async * \u0023m() { return 42; } +}; diff --git a/js/src/tests/test262/language/expressions/class/syntax/early-errors/private-async-method-cannot-escape-token.js b/js/src/tests/test262/language/expressions/class/syntax/early-errors/private-async-method-cannot-escape-token.js new file mode 100644 index 000000000000..fdc8e7e108d7 --- /dev/null +++ b/js/src/tests/test262/language/expressions/class/syntax/early-errors/private-async-method-cannot-escape-token.js @@ -0,0 +1,26 @@ +// |reftest| skip error:SyntaxError -- class-methods-private is not supported +// This file was procedurally generated from the following sources: +// - src/class-elements/private-async-method-cannot-escape-token.case +// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template +/*--- +description: The pound signal in the private async method cannot be escaped (class expression) +esid: prod-ClassElement +features: [class-methods-private, async-functions, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + PrivateName:: + # IdentifierName + + U+0023 is the escape sequence for # + +---*/ + + +$DONOTEVALUATE(); + +var C = class { + async \u0023m() { return 42; } +}; diff --git a/js/src/tests/test262/language/expressions/class/syntax/early-errors/private-call-exp-cannot-escape-token.js b/js/src/tests/test262/language/expressions/class/syntax/early-errors/private-call-exp-cannot-escape-token.js new file mode 100644 index 000000000000..63d9a0b1fb73 --- /dev/null +++ b/js/src/tests/test262/language/expressions/class/syntax/early-errors/private-call-exp-cannot-escape-token.js @@ -0,0 +1,34 @@ +// |reftest| skip error:SyntaxError -- class-fields-private is not supported +// This file was procedurally generated from the following sources: +// - src/class-elements/private-call-exp-cannot-escape-token.case +// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template +/*--- +description: The pound signal in the private reference cannot be escaped (class expression) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + PrivateName :: + # IdentifierName + + MemberExpression : + MemberExpression . PrivateName + + CallExpression : + CallExpression . PrivateName + + U+0023 is the escape sequence for # + +---*/ + + +$DONOTEVALUATE(); + +var C = class { + method() { + foo().\u0023field; + } +}; diff --git a/js/src/tests/test262/language/expressions/class/syntax/early-errors/private-field-cannot-escape-token.js b/js/src/tests/test262/language/expressions/class/syntax/early-errors/private-field-cannot-escape-token.js new file mode 100644 index 000000000000..8dbb8f509200 --- /dev/null +++ b/js/src/tests/test262/language/expressions/class/syntax/early-errors/private-field-cannot-escape-token.js @@ -0,0 +1,26 @@ +// |reftest| skip error:SyntaxError -- class-fields-private is not supported +// This file was procedurally generated from the following sources: +// - src/class-elements/private-field-cannot-escape-token.case +// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template +/*--- +description: The pound signal in the private field cannot be escaped (class expression) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + PrivateName:: + # IdentifierName + + U+0023 is the escape sequence for # + +---*/ + + +$DONOTEVALUATE(); + +var C = class { + \u0023field; +}; diff --git a/js/src/tests/test262/language/expressions/class/syntax/early-errors/private-generator-cannot-escape-token.js b/js/src/tests/test262/language/expressions/class/syntax/early-errors/private-generator-cannot-escape-token.js new file mode 100644 index 000000000000..5fadccdaa8af --- /dev/null +++ b/js/src/tests/test262/language/expressions/class/syntax/early-errors/private-generator-cannot-escape-token.js @@ -0,0 +1,26 @@ +// |reftest| skip error:SyntaxError -- class-methods-private is not supported +// This file was procedurally generated from the following sources: +// - src/class-elements/private-generator-cannot-escape-token.case +// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template +/*--- +description: The pound signal in the private generator cannot be escaped (class expression) +esid: prod-ClassElement +features: [class-methods-private, generators, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + PrivateName:: + # IdentifierName + + U+0023 is the escape sequence for # + +---*/ + + +$DONOTEVALUATE(); + +var C = class { + * \u0023m() { return 42; } +}; diff --git a/js/src/tests/test262/language/expressions/class/syntax/early-errors/private-member-exp-cannot-escape-token.js b/js/src/tests/test262/language/expressions/class/syntax/early-errors/private-member-exp-cannot-escape-token.js new file mode 100644 index 000000000000..7dfcec8d4f22 --- /dev/null +++ b/js/src/tests/test262/language/expressions/class/syntax/early-errors/private-member-exp-cannot-escape-token.js @@ -0,0 +1,34 @@ +// |reftest| skip error:SyntaxError -- class-fields-private is not supported +// This file was procedurally generated from the following sources: +// - src/class-elements/private-member-exp-cannot-escape-token.case +// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template +/*--- +description: The pound signal in the private reference cannot be escaped (class expression) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + PrivateName :: + # IdentifierName + + MemberExpression : + MemberExpression . PrivateName + + CallExpression : + CallExpression . PrivateName + + U+0023 is the escape sequence for # + +---*/ + + +$DONOTEVALUATE(); + +var C = class { + method() { + this.\u0023field; + } +}; diff --git a/js/src/tests/test262/language/expressions/class/syntax/early-errors/private-method-cannot-escape-token.js b/js/src/tests/test262/language/expressions/class/syntax/early-errors/private-method-cannot-escape-token.js new file mode 100644 index 000000000000..2e03ae05ccf0 --- /dev/null +++ b/js/src/tests/test262/language/expressions/class/syntax/early-errors/private-method-cannot-escape-token.js @@ -0,0 +1,26 @@ +// |reftest| skip error:SyntaxError -- class-methods-private is not supported +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-cannot-escape-token.case +// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template +/*--- +description: The pound signal in the private method cannot be escaped (class expression) +esid: prod-ClassElement +features: [class-methods-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + PrivateName:: + # IdentifierName + + U+0023 is the escape sequence for # + +---*/ + + +$DONOTEVALUATE(); + +var C = class { + \u0023m() { return 42; } +}; diff --git a/js/src/tests/test262/language/expressions/dynamic-import/indirect-resolution-1_FIXTURE.js b/js/src/tests/test262/language/expressions/dynamic-import/indirect-resolution-1_FIXTURE.js index d726daed93a9..d444979caa92 100644 --- a/js/src/tests/test262/language/expressions/dynamic-import/indirect-resolution-1_FIXTURE.js +++ b/js/src/tests/test262/language/expressions/dynamic-import/indirect-resolution-1_FIXTURE.js @@ -2,4 +2,4 @@ // Copyright (C) 2018 Leo Balter. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. -export default import('indirect-resolution-2_FIXTURE.js'); +export default import('./indirect-resolution-2_FIXTURE.js'); diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/default-property-not-set-own.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/default-property-not-set-own.js index f462ee23beb1..8daace590368 100644 --- a/js/src/tests/test262/language/expressions/dynamic-import/namespace/default-property-not-set-own.js +++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/default-property-not-set-own.js @@ -27,7 +27,7 @@ info: | 5. Return namespace. ---*/ -import('./default-property-not-set-own.js').then(ns => { +import('./empty_FIXTURE.js').then(ns => { assert.sameValue(Object.prototype.hasOwnProperty.call(ns, 'default'), false); diff --git a/js/src/tests/test262/language/expressions/object/method-definition/private-name-early-error-async-fn-inside-class.js b/js/src/tests/test262/language/expressions/object/method-definition/private-name-early-error-async-fn-inside-class.js new file mode 100644 index 000000000000..153018e9040b --- /dev/null +++ b/js/src/tests/test262/language/expressions/object/method-definition/private-name-early-error-async-fn-inside-class.js @@ -0,0 +1,27 @@ +// |reftest| skip error:SyntaxError -- class-methods-private,class-fields-public is not supported +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-method-definitions-static-semantics-early-errors +description: > + Throws an early SyntaxError if a method definition has a private name even + inside a class body (async method). +info: | + Static Semantics: Early Errors + + PropertyDefinition : MethodDefinition + It is a Syntax Error if PrivateBoundNames of MethodDefinition is non-empty. +negative: + phase: parse + type: SyntaxError +features: [class-methods-private, async-functions, class, class-fields-public] +---*/ + +$DONOTEVALUATE(); + +class C { + field = { + async #m() {} + } +} diff --git a/js/src/tests/test262/language/expressions/object/method-definition/private-name-early-error-async-fn.js b/js/src/tests/test262/language/expressions/object/method-definition/private-name-early-error-async-fn.js new file mode 100644 index 000000000000..ec3e896c118c --- /dev/null +++ b/js/src/tests/test262/language/expressions/object/method-definition/private-name-early-error-async-fn.js @@ -0,0 +1,25 @@ +// |reftest| skip error:SyntaxError -- class-methods-private is not supported +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-method-definitions-static-semantics-early-errors +description: > + Throws an early SyntaxError if a method definition has a private name + (async method). +info: | + Static Semantics: Early Errors + + PropertyDefinition : MethodDefinition + It is a Syntax Error if PrivateBoundNames of MethodDefinition is non-empty. +negative: + phase: parse + type: SyntaxError +features: [class-methods-private, async-functions] +---*/ + +$DONOTEVALUATE(); + +var o = { + async #m() {} +}; diff --git a/js/src/tests/test262/language/expressions/object/method-definition/private-name-early-error-async-gen-inside-class.js b/js/src/tests/test262/language/expressions/object/method-definition/private-name-early-error-async-gen-inside-class.js new file mode 100644 index 000000000000..444212878f0e --- /dev/null +++ b/js/src/tests/test262/language/expressions/object/method-definition/private-name-early-error-async-gen-inside-class.js @@ -0,0 +1,27 @@ +// |reftest| skip error:SyntaxError -- class-methods-private,class-fields-public is not supported +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-method-definitions-static-semantics-early-errors +description: > + Throws an early SyntaxError if a method definition has a private name even + inside a class body. (async generator) +info: | + Static Semantics: Early Errors + + PropertyDefinition : MethodDefinition + It is a Syntax Error if PrivateBoundNames of MethodDefinition is non-empty. +negative: + phase: parse + type: SyntaxError +features: [class-methods-private, async-iteration, class, class-fields-public] +---*/ + +$DONOTEVALUATE(); + +class C { + field = { + async * #m() {} + } +} diff --git a/js/src/tests/test262/language/expressions/object/method-definition/private-name-early-error-async-gen.js b/js/src/tests/test262/language/expressions/object/method-definition/private-name-early-error-async-gen.js new file mode 100644 index 000000000000..04072288e001 --- /dev/null +++ b/js/src/tests/test262/language/expressions/object/method-definition/private-name-early-error-async-gen.js @@ -0,0 +1,25 @@ +// |reftest| skip error:SyntaxError -- class-methods-private is not supported +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-method-definitions-static-semantics-early-errors +description: > + Throws an early SyntaxError if a method definition has a private name. + (async generator) +info: | + Static Semantics: Early Errors + + PropertyDefinition : MethodDefinition + It is a Syntax Error if PrivateBoundNames of MethodDefinition is non-empty. +negative: + phase: parse + type: SyntaxError +features: [class-methods-private, async-iteration] +---*/ + +$DONOTEVALUATE(); + +var o = { + async * #m() {} +}; diff --git a/js/src/tests/test262/language/expressions/object/method-definition/private-name-early-error-gen-inside-class.js b/js/src/tests/test262/language/expressions/object/method-definition/private-name-early-error-gen-inside-class.js new file mode 100644 index 000000000000..9575781c2b9e --- /dev/null +++ b/js/src/tests/test262/language/expressions/object/method-definition/private-name-early-error-gen-inside-class.js @@ -0,0 +1,27 @@ +// |reftest| skip error:SyntaxError -- class-methods-private,class-fields-public is not supported +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-method-definitions-static-semantics-early-errors +description: > + Throws an early SyntaxError if a method definition has a private name even + inside a class body. (generator) +info: | + Static Semantics: Early Errors + + PropertyDefinition : MethodDefinition + It is a Syntax Error if PrivateBoundNames of MethodDefinition is non-empty. +negative: + phase: parse + type: SyntaxError +features: [class-methods-private, generators, class, class-fields-public] +---*/ + +$DONOTEVALUATE(); + +class C { + field = { + * #m() {} + } +} diff --git a/js/src/tests/test262/language/expressions/object/method-definition/private-name-early-error-gen.js b/js/src/tests/test262/language/expressions/object/method-definition/private-name-early-error-gen.js new file mode 100644 index 000000000000..5a64d18dafde --- /dev/null +++ b/js/src/tests/test262/language/expressions/object/method-definition/private-name-early-error-gen.js @@ -0,0 +1,25 @@ +// |reftest| skip error:SyntaxError -- class-methods-private is not supported +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-method-definitions-static-semantics-early-errors +description: > + Throws an early SyntaxError if a method definition has a private name. + (generator) +info: | + Static Semantics: Early Errors + + PropertyDefinition : MethodDefinition + It is a Syntax Error if PrivateBoundNames of MethodDefinition is non-empty. +negative: + phase: parse + type: SyntaxError +features: [class-methods-private, generators] +---*/ + +$DONOTEVALUATE(); + +var o = { + * #m() {} +}; diff --git a/js/src/tests/test262/language/expressions/object/method-definition/private-name-early-error-get-method-inside-class.js b/js/src/tests/test262/language/expressions/object/method-definition/private-name-early-error-get-method-inside-class.js new file mode 100644 index 000000000000..9e3ec84aee93 --- /dev/null +++ b/js/src/tests/test262/language/expressions/object/method-definition/private-name-early-error-get-method-inside-class.js @@ -0,0 +1,27 @@ +// |reftest| skip error:SyntaxError -- class-methods-private,class-fields-public is not supported +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-method-definitions-static-semantics-early-errors +description: > + Throws an early SyntaxError if a method definition has a private name even + inside a class body. (getter method) +info: | + Static Semantics: Early Errors + + PropertyDefinition : MethodDefinition + It is a Syntax Error if PrivateBoundNames of MethodDefinition is non-empty. +negative: + phase: parse + type: SyntaxError +features: [class-methods-private, class, class-fields-public] +---*/ + +$DONOTEVALUATE(); + +class C { + field = { + get #m() {} + } +} diff --git a/js/src/tests/test262/language/expressions/object/method-definition/private-name-early-error-get-method.js b/js/src/tests/test262/language/expressions/object/method-definition/private-name-early-error-get-method.js new file mode 100644 index 000000000000..eb130aa2485f --- /dev/null +++ b/js/src/tests/test262/language/expressions/object/method-definition/private-name-early-error-get-method.js @@ -0,0 +1,25 @@ +// |reftest| skip error:SyntaxError -- class-methods-private is not supported +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-method-definitions-static-semantics-early-errors +description: > + Throws an early SyntaxError if a method definition has a private name. + (getter method) +info: | + Static Semantics: Early Errors + + PropertyDefinition : MethodDefinition + It is a Syntax Error if PrivateBoundNames of MethodDefinition is non-empty. +negative: + phase: parse + type: SyntaxError +features: [class-methods-private] +---*/ + +$DONOTEVALUATE(); + +var o = { + get #m() {} +}; diff --git a/js/src/tests/test262/language/expressions/object/method-definition/private-name-early-error-method-inside-class.js b/js/src/tests/test262/language/expressions/object/method-definition/private-name-early-error-method-inside-class.js new file mode 100644 index 000000000000..8d6cc299b883 --- /dev/null +++ b/js/src/tests/test262/language/expressions/object/method-definition/private-name-early-error-method-inside-class.js @@ -0,0 +1,27 @@ +// |reftest| skip error:SyntaxError -- class-methods-private,class-fields-public is not supported +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-method-definitions-static-semantics-early-errors +description: > + Throws an early SyntaxError if a method definition has a private name even + inside a class body. (ordinary method) +info: | + Static Semantics: Early Errors + + PropertyDefinition : MethodDefinition + It is a Syntax Error if PrivateBoundNames of MethodDefinition is non-empty. +negative: + phase: parse + type: SyntaxError +features: [class-methods-private, class, class-fields-public] +---*/ + +$DONOTEVALUATE(); + +class C { + field = { + #m() {} + } +} diff --git a/js/src/tests/test262/language/expressions/object/method-definition/private-name-early-error-method.js b/js/src/tests/test262/language/expressions/object/method-definition/private-name-early-error-method.js new file mode 100644 index 000000000000..c693d16eda77 --- /dev/null +++ b/js/src/tests/test262/language/expressions/object/method-definition/private-name-early-error-method.js @@ -0,0 +1,25 @@ +// |reftest| skip error:SyntaxError -- class-methods-private is not supported +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-method-definitions-static-semantics-early-errors +description: > + Throws an early SyntaxError if a method definition has a private name. + (ordinary method) +info: | + Static Semantics: Early Errors + + PropertyDefinition : MethodDefinition + It is a Syntax Error if PrivateBoundNames of MethodDefinition is non-empty. +negative: + phase: parse + type: SyntaxError +features: [class-methods-private] +---*/ + +$DONOTEVALUATE(); + +var o = { + #m() {} +}; diff --git a/js/src/tests/test262/language/expressions/object/method-definition/private-name-early-error-set-method-inside-class.js b/js/src/tests/test262/language/expressions/object/method-definition/private-name-early-error-set-method-inside-class.js new file mode 100644 index 000000000000..9cee40183d63 --- /dev/null +++ b/js/src/tests/test262/language/expressions/object/method-definition/private-name-early-error-set-method-inside-class.js @@ -0,0 +1,27 @@ +// |reftest| skip error:SyntaxError -- class-methods-private,class-fields-public is not supported +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-method-definitions-static-semantics-early-errors +description: > + Throws an early SyntaxError if a method definition has a private name even + inside a class body. (getter method) +info: | + Static Semantics: Early Errors + + PropertyDefinition : MethodDefinition + It is a Syntax Error if PrivateBoundNames of MethodDefinition is non-empty. +negative: + phase: parse + type: SyntaxError +features: [class-methods-private, class, class-fields-public] +---*/ + +$DONOTEVALUATE(); + +class C { + field = { + set #m(x) {} + } +} diff --git a/js/src/tests/test262/language/expressions/object/method-definition/private-name-early-error-set-method.js b/js/src/tests/test262/language/expressions/object/method-definition/private-name-early-error-set-method.js new file mode 100644 index 000000000000..e9d15213de9d --- /dev/null +++ b/js/src/tests/test262/language/expressions/object/method-definition/private-name-early-error-set-method.js @@ -0,0 +1,25 @@ +// |reftest| skip error:SyntaxError -- class-methods-private is not supported +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-method-definitions-static-semantics-early-errors +description: > + Throws an early SyntaxError if a method definition has a private name. + (getter method) +info: | + Static Semantics: Early Errors + + PropertyDefinition : MethodDefinition + It is a Syntax Error if PrivateBoundNames of MethodDefinition is non-empty. +negative: + phase: parse + type: SyntaxError +features: [class-methods-private] +---*/ + +$DONOTEVALUATE(); + +var o = { + set #m(x) {} +}; diff --git a/js/src/tests/test262/language/statements/class/private-methods/browser.js b/js/src/tests/test262/language/statements/class/private-methods/browser.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test262/language/statements/class/private-methods/prod-private-async-generator.js b/js/src/tests/test262/language/statements/class/private-methods/prod-private-async-generator.js new file mode 100644 index 000000000000..424d7ceec2c0 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/private-methods/prod-private-async-generator.js @@ -0,0 +1,134 @@ +// |reftest| skip -- class-methods-private is not supported +// This file was procedurally generated from the following sources: +// - src/class-elements/prod-private-async-generator.case +// - src/class-elements/private-methods/cls-decl.template +/*--- +description: Private Async Generator (private method definitions in a class declaration) +esid: prod-MethodDefinition +features: [async-iteration, class, class-methods-private] +flags: [generated, async] +info: | + ClassElement : + MethodDefinition + ... + ; + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + GeneratorMethod + AsyncMethod + AsyncGeneratorMethod + get ClassElementName () { FunctionBody } + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){GeneratorBody} + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ) { AsyncFunctionBody } + + AsyncGeneratorMethod : + async [no LineTerminator here]* ClassElementName ( UniqueFormalParameters ) { AsyncGeneratorBody } + + --- + + InitializeClassElements ( F, proto ) + + ... + 5. For each item element in order from elements, + a. Assert: If element.[[Placement]] is "prototype" or "static", then element.[[Key]] is not a Private Name. + b. If element.[[Kind]] is "method" and element.[[Placement]] is "static" or "prototype", + i. Let receiver be F if element.[[Placement]] is "static", else let receiver be proto. + ii. Perform ? DefineClassElement(receiver, element). + + InitializeInstanceElements ( O, constructor ) + + ... + 3. Let elements be the value of F's [[Elements]] internal slot. + 4. For each item element in order from elements, + a. If element.[[Placement]] is "own" and element.[[Kind]] is "method", + i. Perform ? DefineClassElement(O, element). + + DefineClassElement (receiver, element) + + ... + 6. If key is a Private Name, + a. Perform ? PrivateFieldDefine(receiver, key, descriptor). + + PrivateFieldDefine (P, O, desc) + + ... + 6. Append { [[PrivateName]]: P, [[PrivateFieldDescriptor]]: desc } to O.[[PrivateFieldDescriptors]]. + +---*/ +var ctorPromise; + + + +/*** template notes + * method should always be #m + * the template provides c.ref() for external reference + */ + +function hasProp(obj, name, expected, msg) { + var hasOwnProperty = Object.prototype.hasOwnProperty.call(obj, name); + assert.sameValue(hasOwnProperty, expected, msg); + + var hasProperty = Reflect.has(obj, name); + assert.sameValue(hasProperty, expected, msg); +} + +class C { + async * #m() { return 42; } + + + get ref() { return this.#m; } + + constructor() { + hasProp(this, '#m', false, 'private methods are defined in an special internal slot and cannot be found as own properties'); + assert.sameValue(typeof this.#m, 'function'); + assert.sameValue(this.ref, this.#m, 'returns the same value'); + assert.sameValue(this.#m, (() => this)().#m, 'memberexpression and call expression forms'); + + var ctorIter = this.#m(); + var p = ctorIter.next(); + ctorPromise = p.then(({ value, done }) => { + assert.sameValue(value, 42, 'return from generator method, inside ctor'); + assert.sameValue(done, true, 'iterator is done, inside ctor'); + }, $DONE); + assert.sameValue(this.#m.name, '#m', 'function name inside constructor'); + + } +} + +var c = new C(); +var other = new C(); + +hasProp(C.prototype, '#m', false, 'method is not defined in the prototype'); +hasProp(C, '#m', false, 'method is not defined in the contructor'); +hasProp(c, '#m', false, 'method cannot be seen outside of the class'); + +/*** + * MethodDefinition : ClassElementName ( UniqueFormalParameters ) { FunctionBody } + * + * 1. Let methodDef be DefineMethod of MethodDefinition with argument homeObject. + * ... + */ +assert.sameValue(c.ref, other.ref, 'The method is defined once, and reused on every new instance'); + +assert.sameValue(c.ref.name, '#m', 'function name is preserved external reference'); +ctorPromise.then(() => { + // gets the returned async iterator from #m + var iter = c.ref(); + return iter.next().then(({ value, done }) => { + assert.sameValue(value, 42, 'return from generator method'); + assert.sameValue(done, true, 'iterator is done'); + }); +}, $DONE).then($DONE, $DONE); diff --git a/js/src/tests/test262/language/statements/class/private-methods/prod-private-async-method.js b/js/src/tests/test262/language/statements/class/private-methods/prod-private-async-method.js new file mode 100644 index 000000000000..aa899ddd2de7 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/private-methods/prod-private-async-method.js @@ -0,0 +1,129 @@ +// |reftest| skip -- class-methods-private is not supported +// This file was procedurally generated from the following sources: +// - src/class-elements/prod-private-async-method.case +// - src/class-elements/private-methods/cls-decl.template +/*--- +description: Private Async Method (private method definitions in a class declaration) +esid: prod-MethodDefinition +features: [async-functions, class, class-methods-private] +flags: [generated, async] +info: | + ClassElement : + MethodDefinition + ... + ; + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + GeneratorMethod + AsyncMethod + AsyncGeneratorMethod + get ClassElementName () { FunctionBody } + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){GeneratorBody} + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ) { AsyncFunctionBody } + + AsyncGeneratorMethod : + async [no LineTerminator here]* ClassElementName ( UniqueFormalParameters ) { AsyncGeneratorBody } + + --- + + InitializeClassElements ( F, proto ) + + ... + 5. For each item element in order from elements, + a. Assert: If element.[[Placement]] is "prototype" or "static", then element.[[Key]] is not a Private Name. + b. If element.[[Kind]] is "method" and element.[[Placement]] is "static" or "prototype", + i. Let receiver be F if element.[[Placement]] is "static", else let receiver be proto. + ii. Perform ? DefineClassElement(receiver, element). + + InitializeInstanceElements ( O, constructor ) + + ... + 3. Let elements be the value of F's [[Elements]] internal slot. + 4. For each item element in order from elements, + a. If element.[[Placement]] is "own" and element.[[Kind]] is "method", + i. Perform ? DefineClassElement(O, element). + + DefineClassElement (receiver, element) + + ... + 6. If key is a Private Name, + a. Perform ? PrivateFieldDefine(receiver, key, descriptor). + + PrivateFieldDefine (P, O, desc) + + ... + 6. Append { [[PrivateName]]: P, [[PrivateFieldDescriptor]]: desc } to O.[[PrivateFieldDescriptors]]. + +---*/ +var ctorPromise; + + + +/*** template notes + * method should always be #m + * the template provides c.ref() for external reference + */ + +function hasProp(obj, name, expected, msg) { + var hasOwnProperty = Object.prototype.hasOwnProperty.call(obj, name); + assert.sameValue(hasOwnProperty, expected, msg); + + var hasProperty = Reflect.has(obj, name); + assert.sameValue(hasProperty, expected, msg); +} + +class C { + async #m() { return 42; } + + + get ref() { return this.#m; } + + constructor() { + hasProp(this, '#m', false, 'private methods are defined in an special internal slot and cannot be found as own properties'); + assert.sameValue(typeof this.#m, 'function'); + assert.sameValue(this.ref, this.#m, 'returns the same value'); + assert.sameValue(this.#m, (() => this)().#m, 'memberexpression and call expression forms'); + + assert.sameValue(this.#m.name, '#m', 'function name inside constructor'); + ctorPromise = this.#m().then(value => { + assert.sameValue(value, 42, 'already defined in the ctor'); + }, $DONE); + + } +} + +var c = new C(); +var other = new C(); + +hasProp(C.prototype, '#m', false, 'method is not defined in the prototype'); +hasProp(C, '#m', false, 'method is not defined in the contructor'); +hasProp(c, '#m', false, 'method cannot be seen outside of the class'); + +/*** + * MethodDefinition : ClassElementName ( UniqueFormalParameters ) { FunctionBody } + * + * 1. Let methodDef be DefineMethod of MethodDefinition with argument homeObject. + * ... + */ +assert.sameValue(c.ref, other.ref, 'The method is defined once, and reused on every new instance'); + +assert.sameValue(c.ref.name, '#m', 'function name is preserved external reference'); +ctorPromise.then(() => { + // gets the returned promise from #m + return c.ref().then(value => { + assert.sameValue(value, 42, 'function return'); + }); +}, $DONE).then($DONE, $DONE); diff --git a/js/src/tests/test262/language/statements/class/private-methods/prod-private-generator.js b/js/src/tests/test262/language/statements/class/private-methods/prod-private-generator.js new file mode 100644 index 000000000000..c9dacee33cef --- /dev/null +++ b/js/src/tests/test262/language/statements/class/private-methods/prod-private-generator.js @@ -0,0 +1,127 @@ +// |reftest| skip -- class-methods-private is not supported +// This file was procedurally generated from the following sources: +// - src/class-elements/prod-private-generator.case +// - src/class-elements/private-methods/cls-decl.template +/*--- +description: Private Generator (private method definitions in a class declaration) +esid: prod-MethodDefinition +features: [generators, class, class-methods-private] +flags: [generated] +info: | + ClassElement : + MethodDefinition + ... + ; + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + GeneratorMethod + AsyncMethod + AsyncGeneratorMethod + get ClassElementName () { FunctionBody } + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){GeneratorBody} + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ) { AsyncFunctionBody } + + AsyncGeneratorMethod : + async [no LineTerminator here]* ClassElementName ( UniqueFormalParameters ) { AsyncGeneratorBody } + + --- + + InitializeClassElements ( F, proto ) + + ... + 5. For each item element in order from elements, + a. Assert: If element.[[Placement]] is "prototype" or "static", then element.[[Key]] is not a Private Name. + b. If element.[[Kind]] is "method" and element.[[Placement]] is "static" or "prototype", + i. Let receiver be F if element.[[Placement]] is "static", else let receiver be proto. + ii. Perform ? DefineClassElement(receiver, element). + + InitializeInstanceElements ( O, constructor ) + + ... + 3. Let elements be the value of F's [[Elements]] internal slot. + 4. For each item element in order from elements, + a. If element.[[Placement]] is "own" and element.[[Kind]] is "method", + i. Perform ? DefineClassElement(O, element). + + DefineClassElement (receiver, element) + + ... + 6. If key is a Private Name, + a. Perform ? PrivateFieldDefine(receiver, key, descriptor). + + PrivateFieldDefine (P, O, desc) + + ... + 6. Append { [[PrivateName]]: P, [[PrivateFieldDescriptor]]: desc } to O.[[PrivateFieldDescriptors]]. + +---*/ + + +/*** template notes + * method should always be #m + * the template provides c.ref() for external reference + */ + +function hasProp(obj, name, expected, msg) { + var hasOwnProperty = Object.prototype.hasOwnProperty.call(obj, name); + assert.sameValue(hasOwnProperty, expected, msg); + + var hasProperty = Reflect.has(obj, name); + assert.sameValue(hasProperty, expected, msg); +} + +class C { + * #m() { return 42; } + + + get ref() { return this.#m; } + + constructor() { + hasProp(this, '#m', false, 'private methods are defined in an special internal slot and cannot be found as own properties'); + assert.sameValue(typeof this.#m, 'function'); + assert.sameValue(this.ref, this.#m, 'returns the same value'); + assert.sameValue(this.#m, (() => this)().#m, 'memberexpression and call expression forms'); + + var res = this.#m().next(); + assert.sameValue(res.value, 42, 'return from generator method, inside ctor'); + assert.sameValue(res.done, true, 'iterator is done, inside ctor'); + assert.sameValue(this.#m.name, '#m', 'function name inside constructor'); + + } +} + +var c = new C(); +var other = new C(); + +hasProp(C.prototype, '#m', false, 'method is not defined in the prototype'); +hasProp(C, '#m', false, 'method is not defined in the contructor'); +hasProp(c, '#m', false, 'method cannot be seen outside of the class'); + +/*** + * MethodDefinition : ClassElementName ( UniqueFormalParameters ) { FunctionBody } + * + * 1. Let methodDef be DefineMethod of MethodDefinition with argument homeObject. + * ... + */ +assert.sameValue(c.ref, other.ref, 'The method is defined once, and reused on every new instance'); + +// gets the returned iterator from #m +var res = c.ref().next(); +assert.sameValue(res.value, 42, 'return from generator method'); +assert.sameValue(res.done, true, 'iterator is done'); +assert.sameValue(c.ref.name, '#m', 'function name is preserved external reference'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statements/class/private-methods/prod-private-method.js b/js/src/tests/test262/language/statements/class/private-methods/prod-private-method.js new file mode 100644 index 000000000000..161a724e110e --- /dev/null +++ b/js/src/tests/test262/language/statements/class/private-methods/prod-private-method.js @@ -0,0 +1,123 @@ +// |reftest| skip -- class-methods-private is not supported +// This file was procedurally generated from the following sources: +// - src/class-elements/prod-private-method.case +// - src/class-elements/private-methods/cls-decl.template +/*--- +description: Private Method (private method definitions in a class declaration) +esid: prod-MethodDefinition +features: [class, class-methods-private] +flags: [generated] +info: | + ClassElement : + MethodDefinition + ... + ; + + ClassElementName : + PropertyName + PrivateName + + PrivateName :: + # IdentifierName + + MethodDefinition : + ClassElementName ( UniqueFormalParameters ) { FunctionBody } + GeneratorMethod + AsyncMethod + AsyncGeneratorMethod + get ClassElementName () { FunctionBody } + set ClassElementName ( PropertySetParameterList ) { FunctionBody } + + GeneratorMethod : + * ClassElementName ( UniqueFormalParameters ){GeneratorBody} + + AsyncMethod : + async [no LineTerminator here] ClassElementName ( UniqueFormalParameters ) { AsyncFunctionBody } + + AsyncGeneratorMethod : + async [no LineTerminator here]* ClassElementName ( UniqueFormalParameters ) { AsyncGeneratorBody } + + --- + + InitializeClassElements ( F, proto ) + + ... + 5. For each item element in order from elements, + a. Assert: If element.[[Placement]] is "prototype" or "static", then element.[[Key]] is not a Private Name. + b. If element.[[Kind]] is "method" and element.[[Placement]] is "static" or "prototype", + i. Let receiver be F if element.[[Placement]] is "static", else let receiver be proto. + ii. Perform ? DefineClassElement(receiver, element). + + InitializeInstanceElements ( O, constructor ) + + ... + 3. Let elements be the value of F's [[Elements]] internal slot. + 4. For each item element in order from elements, + a. If element.[[Placement]] is "own" and element.[[Kind]] is "method", + i. Perform ? DefineClassElement(O, element). + + DefineClassElement (receiver, element) + + ... + 6. If key is a Private Name, + a. Perform ? PrivateFieldDefine(receiver, key, descriptor). + + PrivateFieldDefine (P, O, desc) + + ... + 6. Append { [[PrivateName]]: P, [[PrivateFieldDescriptor]]: desc } to O.[[PrivateFieldDescriptors]]. + +---*/ + + +/*** template notes + * method should always be #m + * the template provides c.ref() for external reference + */ + +function hasProp(obj, name, expected, msg) { + var hasOwnProperty = Object.prototype.hasOwnProperty.call(obj, name); + assert.sameValue(hasOwnProperty, expected, msg); + + var hasProperty = Reflect.has(obj, name); + assert.sameValue(hasProperty, expected, msg); +} + +class C { + #m() { return 42; } + + + get ref() { return this.#m; } + + constructor() { + hasProp(this, '#m', false, 'private methods are defined in an special internal slot and cannot be found as own properties'); + assert.sameValue(typeof this.#m, 'function'); + assert.sameValue(this.ref, this.#m, 'returns the same value'); + assert.sameValue(this.#m, (() => this)().#m, 'memberexpression and call expression forms'); + + assert.sameValue(this.#m(), 42, 'already defined in the ctor'); + assert.sameValue(this.#m.name, '#m', 'function name inside constructor'); + + } +} + +var c = new C(); +var other = new C(); + +hasProp(C.prototype, '#m', false, 'method is not defined in the prototype'); +hasProp(C, '#m', false, 'method is not defined in the contructor'); +hasProp(c, '#m', false, 'method cannot be seen outside of the class'); + +/*** + * MethodDefinition : ClassElementName ( UniqueFormalParameters ) { FunctionBody } + * + * 1. Let methodDef be DefineMethod of MethodDefinition with argument homeObject. + * ... + */ +assert.sameValue(c.ref, other.ref, 'The method is defined once, and reused on every new instance'); + +// gets the returned value from #m +assert.sameValue(c.ref(), 42, 'function return'); +assert.sameValue(c.ref.name, '#m', 'function name is preserved external reference'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/statements/class/private-methods/shell.js b/js/src/tests/test262/language/statements/class/private-methods/shell.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/js/src/tests/test262/language/statements/class/syntax/early-errors/private-async-generator-cannot-escape-token.js b/js/src/tests/test262/language/statements/class/syntax/early-errors/private-async-generator-cannot-escape-token.js new file mode 100644 index 000000000000..c58b24733b39 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/syntax/early-errors/private-async-generator-cannot-escape-token.js @@ -0,0 +1,26 @@ +// |reftest| skip error:SyntaxError -- class-methods-private is not supported +// This file was procedurally generated from the following sources: +// - src/class-elements/private-async-generator-cannot-escape-token.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: The pound signal in the private async generator cannot be escaped (class declaration) +esid: prod-ClassElement +features: [class-methods-private, async-iteration, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + PrivateName:: + # IdentifierName + + U+0023 is the escape sequence for # + +---*/ + + +$DONOTEVALUATE(); + +class C { + async * \u0023m() { return 42; } +} diff --git a/js/src/tests/test262/language/statements/class/syntax/early-errors/private-async-method-cannot-escape-token.js b/js/src/tests/test262/language/statements/class/syntax/early-errors/private-async-method-cannot-escape-token.js new file mode 100644 index 000000000000..3f65f5e1a4c5 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/syntax/early-errors/private-async-method-cannot-escape-token.js @@ -0,0 +1,26 @@ +// |reftest| skip error:SyntaxError -- class-methods-private is not supported +// This file was procedurally generated from the following sources: +// - src/class-elements/private-async-method-cannot-escape-token.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: The pound signal in the private async method cannot be escaped (class declaration) +esid: prod-ClassElement +features: [class-methods-private, async-functions, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + PrivateName:: + # IdentifierName + + U+0023 is the escape sequence for # + +---*/ + + +$DONOTEVALUATE(); + +class C { + async \u0023m() { return 42; } +} diff --git a/js/src/tests/test262/language/statements/class/syntax/early-errors/private-call-exp-cannot-escape-token.js b/js/src/tests/test262/language/statements/class/syntax/early-errors/private-call-exp-cannot-escape-token.js new file mode 100644 index 000000000000..b8423cf20f62 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/syntax/early-errors/private-call-exp-cannot-escape-token.js @@ -0,0 +1,34 @@ +// |reftest| skip error:SyntaxError -- class-fields-private is not supported +// This file was procedurally generated from the following sources: +// - src/class-elements/private-call-exp-cannot-escape-token.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: The pound signal in the private reference cannot be escaped (class declaration) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + PrivateName :: + # IdentifierName + + MemberExpression : + MemberExpression . PrivateName + + CallExpression : + CallExpression . PrivateName + + U+0023 is the escape sequence for # + +---*/ + + +$DONOTEVALUATE(); + +class C { + method() { + foo().\u0023field; + } +} diff --git a/js/src/tests/test262/language/statements/class/syntax/early-errors/private-field-cannot-escape-token.js b/js/src/tests/test262/language/statements/class/syntax/early-errors/private-field-cannot-escape-token.js new file mode 100644 index 000000000000..6a6c8b7feb5d --- /dev/null +++ b/js/src/tests/test262/language/statements/class/syntax/early-errors/private-field-cannot-escape-token.js @@ -0,0 +1,26 @@ +// |reftest| skip error:SyntaxError -- class-fields-private is not supported +// This file was procedurally generated from the following sources: +// - src/class-elements/private-field-cannot-escape-token.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: The pound signal in the private field cannot be escaped (class declaration) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + PrivateName:: + # IdentifierName + + U+0023 is the escape sequence for # + +---*/ + + +$DONOTEVALUATE(); + +class C { + \u0023field; +} diff --git a/js/src/tests/test262/language/statements/class/syntax/early-errors/private-generator-cannot-escape-token.js b/js/src/tests/test262/language/statements/class/syntax/early-errors/private-generator-cannot-escape-token.js new file mode 100644 index 000000000000..f368e2572b70 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/syntax/early-errors/private-generator-cannot-escape-token.js @@ -0,0 +1,26 @@ +// |reftest| skip error:SyntaxError -- class-methods-private is not supported +// This file was procedurally generated from the following sources: +// - src/class-elements/private-generator-cannot-escape-token.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: The pound signal in the private generator cannot be escaped (class declaration) +esid: prod-ClassElement +features: [class-methods-private, generators, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + PrivateName:: + # IdentifierName + + U+0023 is the escape sequence for # + +---*/ + + +$DONOTEVALUATE(); + +class C { + * \u0023m() { return 42; } +} diff --git a/js/src/tests/test262/language/statements/class/syntax/early-errors/private-member-exp-cannot-escape-token.js b/js/src/tests/test262/language/statements/class/syntax/early-errors/private-member-exp-cannot-escape-token.js new file mode 100644 index 000000000000..038264894c9e --- /dev/null +++ b/js/src/tests/test262/language/statements/class/syntax/early-errors/private-member-exp-cannot-escape-token.js @@ -0,0 +1,34 @@ +// |reftest| skip error:SyntaxError -- class-fields-private is not supported +// This file was procedurally generated from the following sources: +// - src/class-elements/private-member-exp-cannot-escape-token.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: The pound signal in the private reference cannot be escaped (class declaration) +esid: prod-ClassElement +features: [class-fields-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + PrivateName :: + # IdentifierName + + MemberExpression : + MemberExpression . PrivateName + + CallExpression : + CallExpression . PrivateName + + U+0023 is the escape sequence for # + +---*/ + + +$DONOTEVALUATE(); + +class C { + method() { + this.\u0023field; + } +} diff --git a/js/src/tests/test262/language/statements/class/syntax/early-errors/private-method-cannot-escape-token.js b/js/src/tests/test262/language/statements/class/syntax/early-errors/private-method-cannot-escape-token.js new file mode 100644 index 000000000000..890d0dd8d681 --- /dev/null +++ b/js/src/tests/test262/language/statements/class/syntax/early-errors/private-method-cannot-escape-token.js @@ -0,0 +1,26 @@ +// |reftest| skip error:SyntaxError -- class-methods-private is not supported +// This file was procedurally generated from the following sources: +// - src/class-elements/private-method-cannot-escape-token.case +// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template +/*--- +description: The pound signal in the private method cannot be escaped (class declaration) +esid: prod-ClassElement +features: [class-methods-private, class] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + PrivateName:: + # IdentifierName + + U+0023 is the escape sequence for # + +---*/ + + +$DONOTEVALUATE(); + +class C { + \u0023m() { return 42; } +}