diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
commit | 2aa4a82499d4becd2284cdb482213d541b8804dd (patch) | |
tree | b80bf8bf13c3766139fbacc530efd0dd9d54394c /js/src/tests/test262/built-ins/Set/Symbol.species | |
parent | Initial commit. (diff) | |
download | firefox-2aa4a82499d4becd2284cdb482213d541b8804dd.tar.xz firefox-2aa4a82499d4becd2284cdb482213d541b8804dd.zip |
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/tests/test262/built-ins/Set/Symbol.species')
6 files changed, 95 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Set/Symbol.species/browser.js b/js/src/tests/test262/built-ins/Set/Symbol.species/browser.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/built-ins/Set/Symbol.species/browser.js diff --git a/js/src/tests/test262/built-ins/Set/Symbol.species/length.js b/js/src/tests/test262/built-ins/Set/Symbol.species/length.js new file mode 100644 index 0000000000..06474ae5bd --- /dev/null +++ b/js/src/tests/test262/built-ins/Set/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: 23.2.2.2 +description: > + get Set [ @@species ].length is 0. +info: | + get Set [ @@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(Set, 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/Set/Symbol.species/return-value.js b/js/src/tests/test262/built-ins/Set/Symbol.species/return-value.js new file mode 100644 index 0000000000..db57da9a59 --- /dev/null +++ b/js/src/tests/test262/built-ins/Set/Symbol.species/return-value.js @@ -0,0 +1,16 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-get-set-@@species +description: Return value of @@species accessor method +info: | + 1. Return the this value. +features: [Symbol.species] +---*/ + +var thisVal = {}; +var accessor = Object.getOwnPropertyDescriptor(Set, Symbol.species).get; + +assert.sameValue(accessor.call(thisVal), thisVal); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Set/Symbol.species/shell.js b/js/src/tests/test262/built-ins/Set/Symbol.species/shell.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/built-ins/Set/Symbol.species/shell.js diff --git a/js/src/tests/test262/built-ins/Set/Symbol.species/symbol-species-name.js b/js/src/tests/test262/built-ins/Set/Symbol.species/symbol-species-name.js new file mode 100644 index 0000000000..c9c06da821 --- /dev/null +++ b/js/src/tests/test262/built-ins/Set/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: 23.2.2.2 +description: > + Set[Symbol.species] accessor property get name +info: | + 23.2.2.2 get Set [ @@species ] + + ... + The value of the name property of this function is "get [Symbol.species]". +features: [Symbol.species] +---*/ + +var descriptor = Object.getOwnPropertyDescriptor(Set, Symbol.species); + +assert.sameValue( + descriptor.get.name, + 'get [Symbol.species]' +); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/Set/Symbol.species/symbol-species.js b/js/src/tests/test262/built-ins/Set/Symbol.species/symbol-species.js new file mode 100644 index 0000000000..f52ab2c093 --- /dev/null +++ b/js/src/tests/test262/built-ins/Set/Symbol.species/symbol-species.js @@ -0,0 +1,23 @@ +// Copyright 2015 Cubane Canada, Inc. All rights reserved. +// See LICENSE for details. + +/*--- +info: | + Set has a property at `Symbol.species` +esid: sec-get-set-@@species +author: Sam Mikes +description: Set[Symbol.species] exists per spec +includes: [propertyHelper.js] +features: [Symbol.species] +---*/ + +var desc = Object.getOwnPropertyDescriptor(Set, Symbol.species); + +assert.sameValue(desc.set, undefined); +assert.sameValue(typeof desc.get, 'function'); + +verifyNotWritable(Set, Symbol.species, Symbol.species); +verifyNotEnumerable(Set, Symbol.species); +verifyConfigurable(Set, Symbol.species); + +reportCompare(0, 0); |