species-get-error.js (759B)
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.race() does not retrieve `Symbol.species` property of the `this` value 7 es6id: 25.4.4.3 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 Object.defineProperty(C, Symbol.species, { 20 get() { 21 throw new Test262Error("Getter for Symbol.species called"); 22 } 23 }); 24 C.resolve = function() { 25 throw new Test262Error(); 26 }; 27 28 Promise.race.call(C, []); 29 30 reportCompare(0, 0);