Debian Codegraph @

js/src/tests/test262/language/expressions/dynamic-import/import-attributes/2nd-param-trailing-comma-reject.js

raw
1 // |reftest| shell-option(--enable-import-attributes) skip-if(!xulRuntime.shell) async -- requires shell-options
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);