From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- .../Symbol.asyncIterator/browser.js | 0 .../Symbol.asyncIterator/length.js | 31 +++++++++++++++++++ .../Symbol.asyncIterator/name.js | 35 ++++++++++++++++++++++ .../Symbol.asyncIterator/prop-desc.js | 28 +++++++++++++++++ .../Symbol.asyncIterator/return-val.js | 33 ++++++++++++++++++++ .../Symbol.asyncIterator/shell.js | 0 .../built-ins/AsyncIteratorPrototype/browser.js | 0 .../built-ins/AsyncIteratorPrototype/shell.js | 0 8 files changed, 127 insertions(+) create mode 100644 js/src/tests/test262/built-ins/AsyncIteratorPrototype/Symbol.asyncIterator/browser.js create mode 100644 js/src/tests/test262/built-ins/AsyncIteratorPrototype/Symbol.asyncIterator/length.js create mode 100644 js/src/tests/test262/built-ins/AsyncIteratorPrototype/Symbol.asyncIterator/name.js create mode 100644 js/src/tests/test262/built-ins/AsyncIteratorPrototype/Symbol.asyncIterator/prop-desc.js create mode 100644 js/src/tests/test262/built-ins/AsyncIteratorPrototype/Symbol.asyncIterator/return-val.js create mode 100644 js/src/tests/test262/built-ins/AsyncIteratorPrototype/Symbol.asyncIterator/shell.js create mode 100644 js/src/tests/test262/built-ins/AsyncIteratorPrototype/browser.js create mode 100644 js/src/tests/test262/built-ins/AsyncIteratorPrototype/shell.js (limited to 'js/src/tests/test262/built-ins/AsyncIteratorPrototype') 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 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 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 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 -- cgit v1.2.3