diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
commit | 6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch) | |
tree | a68f146d7fa01f0134297619fbe7e33db084e0aa /js/src/tests/non262/Iterator/prototype/asIndexedPairs | |
parent | Initial commit. (diff) | |
download | thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.tar.xz thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.zip |
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/tests/non262/Iterator/prototype/asIndexedPairs')
3 files changed, 55 insertions, 0 deletions
diff --git a/js/src/tests/non262/Iterator/prototype/asIndexedPairs/asIndexedPairs.js b/js/src/tests/non262/Iterator/prototype/asIndexedPairs/asIndexedPairs.js new file mode 100644 index 0000000000..42dfb6aaca --- /dev/null +++ b/js/src/tests/non262/Iterator/prototype/asIndexedPairs/asIndexedPairs.js @@ -0,0 +1,15 @@ +// |reftest| skip-if(!this.hasOwnProperty('AsyncIterator')) + +let iter = [1, 2, 3].values().asIndexedPairs(); + +for (const v of [[0, 1], [1, 2], [2, 3]]) { + let result = iter.next(); + assertEq(result.done, false); + assertEq(result.value[0], v[0]); + assertEq(result.value[1], v[1]); +} + +assertEq(iter.next().done, true); + +if (typeof reportCompare === 'function') + reportCompare(0, 0); diff --git a/js/src/tests/non262/Iterator/prototype/asIndexedPairs/length.js b/js/src/tests/non262/Iterator/prototype/asIndexedPairs/length.js new file mode 100644 index 0000000000..4ec7ce238c --- /dev/null +++ b/js/src/tests/non262/Iterator/prototype/asIndexedPairs/length.js @@ -0,0 +1,21 @@ +// |reftest| skip-if(!this.hasOwnProperty('Iterator')) +// + +/*--- +esid: pending +description: %Iterator.prototype%.asIndexedPairs length value and descriptor. +info: > + 17 ECMAScript Standard Built-in Objects +features: [iterator-helpers] +---*/ + +assertEq(Iterator.prototype.asIndexedPairs.length, 0); + +const propertyDescriptor = Reflect.getOwnPropertyDescriptor(Iterator.prototype.asIndexedPairs, 'length'); +assertEq(propertyDescriptor.value, 0); +assertEq(propertyDescriptor.enumerable, false); +assertEq(propertyDescriptor.writable, false); +assertEq(propertyDescriptor.configurable, true); + +if (typeof reportCompare == 'function') + reportCompare(0, 0); diff --git a/js/src/tests/non262/Iterator/prototype/asIndexedPairs/name.js b/js/src/tests/non262/Iterator/prototype/asIndexedPairs/name.js new file mode 100644 index 0000000000..74d31d7905 --- /dev/null +++ b/js/src/tests/non262/Iterator/prototype/asIndexedPairs/name.js @@ -0,0 +1,19 @@ +// |reftest| skip-if(!this.hasOwnProperty('Iterator')) +/*--- +esid: pending +description: %Iterator.prototype%.asIndexedPairs.name value and descriptor. +info: > + 17 ECMAScript Standard Built-in Objects +features: [iterator-helpers] +---*/ + +assertEq(Iterator.prototype.asIndexedPairs.name, 'asIndexedPairs'); + +const propertyDescriptor = Reflect.getOwnPropertyDescriptor(Iterator.prototype.asIndexedPairs, 'name'); +assertEq(propertyDescriptor.value, 'asIndexedPairs'); +assertEq(propertyDescriptor.enumerable, false); +assertEq(propertyDescriptor.writable, false); +assertEq(propertyDescriptor.configurable, true); + +if (typeof reportCompare == 'function') + reportCompare(0, 0); |