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/Set/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/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..a4fc6ac666 --- /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. + +/*--- +esid: sec-get-set-@@species +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..4cbeaf5be9 --- /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. +/*--- +esid: sec-get-set-@@species +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..8f80342ab9 --- /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. + +/*--- +esid: sec-get-set-@@species +description: Set[Symbol.species] exists per spec +info: | + Set has a property at `Symbol.species` +author: Sam Mikes +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); |