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 --- .../built-ins/Promise/Symbol.species/browser.js | 0 .../built-ins/Promise/Symbol.species/length.js | 34 ++++++++++++++++++++++ .../built-ins/Promise/Symbol.species/prop-desc.js | 27 +++++++++++++++++ .../Promise/Symbol.species/return-value.js | 16 ++++++++++ .../built-ins/Promise/Symbol.species/shell.js | 0 .../Promise/Symbol.species/symbol-species-name.js | 22 ++++++++++++++ .../Promise/Symbol.species/symbol-species.js | 20 +++++++++++++ 7 files changed, 119 insertions(+) create mode 100644 js/src/tests/test262/built-ins/Promise/Symbol.species/browser.js create mode 100644 js/src/tests/test262/built-ins/Promise/Symbol.species/length.js create mode 100644 js/src/tests/test262/built-ins/Promise/Symbol.species/prop-desc.js create mode 100644 js/src/tests/test262/built-ins/Promise/Symbol.species/return-value.js create mode 100644 js/src/tests/test262/built-ins/Promise/Symbol.species/shell.js create mode 100644 js/src/tests/test262/built-ins/Promise/Symbol.species/symbol-species-name.js create mode 100644 js/src/tests/test262/built-ins/Promise/Symbol.species/symbol-species.js (limited to 'js/src/tests/test262/built-ins/Promise/Symbol.species') diff --git a/js/src/tests/test262/built-ins/Promise/Symbol.species/browser.js b/js/src/tests/test262/built-ins/Promise/Symbol.species/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/built-ins/Promise/Symbol.species/length.js b/js/src/tests/test262/built-ins/Promise/Symbol.species/length.js new file mode 100644 index 0000000000..a2556d0a44 --- /dev/null +++ b/js/src/tests/test262/built-ins/Promise/Symbol.species/length.js @@ -0,0 +1,34 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 25.4.4.6 +description: > + get Promise [ @@species ].length is 0. +info: | + get Promise [ @@species ] + + 17 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. However, rest parameters shown using the form “...name” + are not included in the default argument count. + + Unless otherwise specified, the length property of a built-in Function + object has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +includes: [propertyHelper.js] +features: [Symbol.species] +---*/ + +var desc = Object.getOwnPropertyDescriptor(Promise, Symbol.species); + +assert.sameValue(desc.get.length, 0); + +verifyNotEnumerable(desc.get, "length"); +verifyNotWritable(desc.get, "length"); +verifyConfigurable(desc.get, "length"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Promise/Symbol.species/prop-desc.js b/js/src/tests/test262/built-ins/Promise/Symbol.species/prop-desc.js new file mode 100644 index 0000000000..13904b6a3a --- /dev/null +++ b/js/src/tests/test262/built-ins/Promise/Symbol.species/prop-desc.js @@ -0,0 +1,27 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +es6id: 25.4.4.6 +description: Promise `Symbol.species` property +info: | + Promise[@@species] is an accessor property whose set accessor function is + undefined. + + ES6 Section 17: + + Every accessor property described in clauses 18 through 26 and in Annex B.2 + has the attributes {[[Enumerable]]: false, [[Configurable]]: true } unless + otherwise specified. +features: [Symbol.species] +includes: [propertyHelper.js] +---*/ + +var desc = Object.getOwnPropertyDescriptor(Promise, Symbol.species); + +assert.sameValue(desc.set, undefined); +assert.sameValue(typeof desc.get, 'function'); + +verifyNotEnumerable(Promise, Symbol.species); +verifyConfigurable(Promise, Symbol.species); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Promise/Symbol.species/return-value.js b/js/src/tests/test262/built-ins/Promise/Symbol.species/return-value.js new file mode 100644 index 0000000000..f4298bc6ab --- /dev/null +++ b/js/src/tests/test262/built-ins/Promise/Symbol.species/return-value.js @@ -0,0 +1,16 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +es6id: 25.4.4.6 +description: Promise `Symbol.species` accessor function return value +info: | + 1. Return the this value. +features: [Symbol.species] +---*/ + +var desc = Object.getOwnPropertyDescriptor(Promise, Symbol.species); +var thisValue = {}; + +assert.sameValue(desc.get.call(thisValue), thisValue); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Promise/Symbol.species/shell.js b/js/src/tests/test262/built-ins/Promise/Symbol.species/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/built-ins/Promise/Symbol.species/symbol-species-name.js b/js/src/tests/test262/built-ins/Promise/Symbol.species/symbol-species-name.js new file mode 100644 index 0000000000..30f74b923b --- /dev/null +++ b/js/src/tests/test262/built-ins/Promise/Symbol.species/symbol-species-name.js @@ -0,0 +1,22 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +es6id: 25.4.4.6 +description: > + Promise[Symbol.species] accessor property get name +info: | + 25.4.4.6 get Promise [ @@species ] + + ... + The value of the name property of this function is "get [Symbol.species]". +features: [Symbol.species] +---*/ + +var descriptor = Object.getOwnPropertyDescriptor(Promise, Symbol.species); + +assert.sameValue( + descriptor.get.name, + 'get [Symbol.species]' +); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Promise/Symbol.species/symbol-species.js b/js/src/tests/test262/built-ins/Promise/Symbol.species/symbol-species.js new file mode 100644 index 0000000000..24da4e82ee --- /dev/null +++ b/js/src/tests/test262/built-ins/Promise/Symbol.species/symbol-species.js @@ -0,0 +1,20 @@ +// Copyright 2015 Cubane Canada, Inc. All rights reserved. +// See LICENSE for details. + +/*--- +info: | + Promise has a property at `Symbol.species` +es6id: 6.1.5.1 +author: Sam Mikes +description: Promise[Symbol.species] exists per spec +includes: [propertyHelper.js] +features: [Symbol.species] +---*/ + +assert.sameValue(Promise[Symbol.species], Promise, "Promise[Symbol.species] is Promise"); + +verifyNotWritable(Promise, Symbol.species, Symbol.species); +verifyNotEnumerable(Promise, Symbol.species); +verifyConfigurable(Promise, Symbol.species); + +reportCompare(0, 0); -- cgit v1.2.3