S25.4.4.1_A5.1_T1.js (819B)
1 // |reftest| async 2 // Copyright 2014 Cubane Canada, Inc. All rights reserved. 3 // See LICENSE for details. 4 5 /*--- 6 info: | 7 Promise.all expects an iterable argument; 8 rejects if IteratorStep() throws 9 es6id: S25.4.4.1_A5.1_T1 10 author: Sam Mikes 11 description: iterator.next throws, causing Promise.all to reject 12 features: [Symbol.iterator] 13 flags: [async] 14 ---*/ 15 16 var iterThrows = {}; 17 var error = new Test262Error(); 18 iterThrows[Symbol.iterator] = function() { 19 return { 20 next: function() { 21 throw error; 22 } 23 }; 24 }; 25 26 Promise.all(iterThrows).then(function() { 27 throw new Test262Error('Promise unexpectedly resolved: Promise.all(iterThrows) should throw TypeError'); 28 }, function(reason) { 29 assert.sameValue(reason, error, 'The value of reason is expected to equal the value of error'); 30 }).then($DONE, $DONE);