Debian Codegraph @

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

raw
1 // Copyright (C) 2015 the V8 project authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 description: >
6 Promise.all() does not retrieve `Symbol.species` property of the `this` value
7 es6id: 25.4.4.1
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: [Symbol.species]
14 ---*/
15
16 function C(executor) {
17 executor(function() {}, function() {});
18 }
19
20 C.resolve = function() {};
21 Object.defineProperty(C, Symbol.species, {
22 get: function() {
23 throw new Test262Error("Getter for Symbol.species called");
24 }
25 });
26
27 Promise.all.call(C, []);
28
29 reportCompare(0, 0);