trailing-comma-reject.js (871B)
1 // |reftest| async 2 // Copyright (C) 2021 the V8 project authors. All rights reserved. 3 // This code is governed by the BSD license found in the LICENSE file. 4 /*--- 5 description: > 6 ImportCall parameter list supports an optional trailing comma (rejection 7 semantics) 8 esid: sec-import-call-runtime-semantics-evaluation 9 info: | 10 ImportCall[Yield, Await]: 11 import ( AssignmentExpression[+In, ?Yield, ?Await] ,opt ) 12 import ( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt ) 13 features: [dynamic-import, import-attributes] 14 flags: [async] 15 ---*/ 16 17 var thrown = new Test262Error(); 18 19 import({toString: function() { throw thrown; } },) 20 .then(function() { 21 throw new Test262Error('Expected promise to be rejected, but it was fulfilled.'); 22 }, function(caught) { 23 assert.sameValue(thrown, caught); 24 }) 25 .then($DONE, $DONE);