diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /js/src/tests/test262/built-ins/AsyncIteratorPrototype | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/tests/test262/built-ins/AsyncIteratorPrototype')
8 files changed, 127 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/AsyncIteratorPrototype/Symbol.asyncIterator/browser.js b/js/src/tests/test262/built-ins/AsyncIteratorPrototype/Symbol.asyncIterator/browser.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/built-ins/AsyncIteratorPrototype/Symbol.asyncIterator/browser.js diff --git a/js/src/tests/test262/built-ins/AsyncIteratorPrototype/Symbol.asyncIterator/length.js b/js/src/tests/test262/built-ins/AsyncIteratorPrototype/Symbol.asyncIterator/length.js new file mode 100644 index 0000000000..c10ec343ee --- /dev/null +++ b/js/src/tests/test262/built-ins/AsyncIteratorPrototype/Symbol.asyncIterator/length.js @@ -0,0 +1,31 @@ +// Copyright (C) 2018 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-asynciteratorprototype-asynciterator +description: Length of AsyncIteratorPrototype[ @@asyncIterator ] +info: | + ECMAScript Standard Built-in Objects + ... + Every built-in Function object, including constructors, has a length + property whose value is an integer. Unless otherwise specified, this value + is equal to the largest number of named arguments shown in the subclause + headings for the function description, including optional parameters. + ... + Unless otherwise specified, the length property of a built-in Function + object has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +features: [Symbol.asyncIterator, async-iteration] +includes: [propertyHelper.js] +---*/ + +async function* generator() {} +var AsyncIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf(generator.prototype)) + +verifyProperty(AsyncIteratorPrototype[Symbol.asyncIterator], "length", { + value: 0, + enumerable: false, + writable: false, + configurable: true, +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/AsyncIteratorPrototype/Symbol.asyncIterator/name.js b/js/src/tests/test262/built-ins/AsyncIteratorPrototype/Symbol.asyncIterator/name.js new file mode 100644 index 0000000000..a18684e9ed --- /dev/null +++ b/js/src/tests/test262/built-ins/AsyncIteratorPrototype/Symbol.asyncIterator/name.js @@ -0,0 +1,35 @@ +// Copyright (C) 2018 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-asynciteratorprototype-asynciterator +description: Descriptor for `name` property +info: | + %AsyncIteratorPrototype% [ @@asyncIterator ] ( ) + ... + The value of the name property of this function is "[Symbol.asyncIterator]". + + ECMAScript Standard Built-in Objects + ... + Every built-in Function object, including constructors, that is not + identified as an anonymous function has a name property whose value is a + String. Unless otherwise specified, this value is the name that is given to + the function in this specification. + ... + Unless otherwise specified, the name property of a built-in Function + object, if it exists, has the attributes { [[Writable]]: false, + [[Enumerable]]: false, [[Configurable]]: true }. +features: [Symbol.asyncIterator, async-iteration] +includes: [propertyHelper.js] +---*/ + +async function* generator() {} +var AsyncIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf(generator.prototype)) + +verifyProperty(AsyncIteratorPrototype[Symbol.asyncIterator], "name", { + value: '[Symbol.asyncIterator]', + enumerable: false, + writable: false, + configurable: true, +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/AsyncIteratorPrototype/Symbol.asyncIterator/prop-desc.js b/js/src/tests/test262/built-ins/AsyncIteratorPrototype/Symbol.asyncIterator/prop-desc.js new file mode 100644 index 0000000000..54939cbf3b --- /dev/null +++ b/js/src/tests/test262/built-ins/AsyncIteratorPrototype/Symbol.asyncIterator/prop-desc.js @@ -0,0 +1,28 @@ +// Copyright (C) 2018 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-asynciteratorprototype +description: Property descriptor +info: | + ECMAScript Standard Built-in Objects + + Every other data property described in clauses 18 through 26 and in Annex + B.2 has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +features: [Symbol.asyncIterator, async-iteration] +includes: [propertyHelper.js] +---*/ + +async function* generator() {} +var AsyncIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf(generator.prototype)) + +assert.sameValue(typeof AsyncIteratorPrototype[Symbol.asyncIterator], 'function'); + +verifyProperty(AsyncIteratorPrototype, Symbol.asyncIterator, { + enumerable: false, + writable: true, + configurable: true, +}); + + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/AsyncIteratorPrototype/Symbol.asyncIterator/return-val.js b/js/src/tests/test262/built-ins/AsyncIteratorPrototype/Symbol.asyncIterator/return-val.js new file mode 100644 index 0000000000..5569217568 --- /dev/null +++ b/js/src/tests/test262/built-ins/AsyncIteratorPrototype/Symbol.asyncIterator/return-val.js @@ -0,0 +1,33 @@ +// Copyright (C) 2018 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-asynciteratorprototype-asynciterator +description: Return value of @@asyncIterator +info: | + %AsyncIteratorPrototype% [ @@asyncIterator ] ( ) + 1. Return the this value. +features: [Symbol.asyncIterator, async-iteration] +---*/ + +async function* generator() {} +const AsyncIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf(generator.prototype)) +const getAsyncIterator = AsyncIteratorPrototype[Symbol.asyncIterator]; + +const thisValues = [ + {}, + Symbol(), + 4, + 4n, + true, + undefined, + null, +]; + +for (const thisValue of thisValues) { + assert.sameValue( + getAsyncIterator.call(thisValue), + thisValue + ); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/AsyncIteratorPrototype/Symbol.asyncIterator/shell.js b/js/src/tests/test262/built-ins/AsyncIteratorPrototype/Symbol.asyncIterator/shell.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/built-ins/AsyncIteratorPrototype/Symbol.asyncIterator/shell.js diff --git a/js/src/tests/test262/built-ins/AsyncIteratorPrototype/browser.js b/js/src/tests/test262/built-ins/AsyncIteratorPrototype/browser.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/built-ins/AsyncIteratorPrototype/browser.js diff --git a/js/src/tests/test262/built-ins/AsyncIteratorPrototype/shell.js b/js/src/tests/test262/built-ins/AsyncIteratorPrototype/shell.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/built-ins/AsyncIteratorPrototype/shell.js |