evaluation-default-that-throws.js (567B)
1 // |reftest| async 2 // Copyright 2016 Microsoft, Inc. All rights reserved. 3 // This code is governed by the BSD license found in the LICENSE file. 4 5 /*--- 6 author: Brian Terlson <brian.terlson@microsoft.com> 7 esid: pending 8 description: > 9 If a default expression throws, the promise is rejected. 10 info: | 11 This is different from generators which will throw the error out of the generator 12 when it is called. 13 flags: [async] 14 ---*/ 15 var y = null; 16 async function foo(x = y()) {} 17 foo().then(function () { 18 $DONE('promise should be rejected'); 19 }, function () { 20 $DONE(); 21 });