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/Promise/Symbol.species | |
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/Promise/Symbol.species')
7 files changed, 119 insertions, 0 deletions
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 --- /dev/null +++ b/js/src/tests/test262/built-ins/Promise/Symbol.species/browser.js 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 --- /dev/null +++ b/js/src/tests/test262/built-ins/Promise/Symbol.species/shell.js 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); |