Debian Codegraph @

js/src/tests/test262/built-ins/Promise/allSettled/species-get-error.js

raw
1 // Copyright (C) 2019 Leo Balter. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 description: >
6 Promise.allSettled() does not retrieve `Symbol.species` property of the `this` value
7 esid: sec-promise.allsettled
8 info: |
9 1. Let C be the this value.
10 2. If Type(C) is not Object, throw a TypeError exception.
11 3. Let promiseCapability be ? NewPromiseCapability(C).
12 ...
13 features: [Promise.allSettled, Symbol.species]
14 ---*/
15
16 function C(executor) {
17 executor(function() {}, function() {});
18 }
19 Object.defineProperty(C, Symbol.species, {
20 get() {
21 throw new Test262Error('Getter for Symbol.species called');
22 }
23 });
24
25 C.resolve = function() {
26 throw new Test262Error();
27 };
28
29 Promise.allSettled.call(C, []);
30
31 reportCompare(0, 0);