iter-arg-is-string-resolve.js (895B)
1 // |reftest| async 2 // Copyright (C) 2018 Rick Waldron. All rights reserved. 3 // This code is governed by the BSD license found in the LICENSE file. 4 5 /*--- 6 esid: sec-promise.all 7 description: > 8 Resolve when argument is a string 9 info: | 10 ... 11 Let iteratorRecord be GetIterator(iterable). 12 IfAbruptRejectPromise(iteratorRecord, promiseCapability). 13 ... 14 15 #sec-getiterator 16 GetIterator ( obj [ , hint [ , method ] ] ) 17 18 ... 19 Let iterator be ? Call(method, obj). 20 If Type(iterator) is not Object, throw a TypeError exception. 21 ... 22 features: [Symbol.iterator] 23 flags: [async] 24 ---*/ 25 26 try { 27 Promise.all("").then(function(v) { 28 assert.sameValue(v.length, 0); 29 }, function() { 30 $DONE('The promise should be resolved, but was rejected'); 31 }).then($DONE, $DONE); 32 } catch (error) { 33 $DONE(`The promise should be resolved, but threw an exception: ${error.message}`); 34 }