| 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: Reports abrupt completions produced by attributes enumeration |
| 6 |
esid: sec-import-call-runtime-semantics-evaluation |
| 7 |
info: | |
| 8 |
2.1.1.1 EvaluateImportCall ( specifierExpression [ , optionsExpression ] ) |
| 9 |
[...] |
| 10 |
6. Let promiseCapability be ! NewPromiseCapability(%Promise%). |
| 11 |
7. Let specifierString be ToString(specifier). |
| 12 |
8. IfAbruptRejectPromise(specifierString, promiseCapability). |
| 13 |
9. Let assertions be a new empty List. |
| 14 |
10. If options is not undefined, then |
| 15 |
a. If Type(options) is not Object, |
| 16 |
[...] |
| 17 |
b. Let assertionsObj be Get(options, "assert"). |
| 18 |
c. IfAbruptRejectPromise(assertionsObj, promiseCapability). |
| 19 |
d. If assertionsObj is not undefined, |
| 20 |
i. If Type(assertionsObj) is not Object, |
| 21 |
[...] |
| 22 |
ii. Let keys be EnumerableOwnPropertyNames(assertionsObj, key). |
| 23 |
iii. IfAbruptRejectPromise(keys, promiseCapability). |
| 24 |
[...] |
| 25 |
features: [dynamic-import, import-attributes, Proxy] |
| 26 |
flags: [async] |
| 27 |
---*/ |
| 28 |
|
| 29 |
var thrown = new Test262Error(); |
| 30 |
var options = { |
| 31 |
with: new Proxy({}, { |
| 32 |
ownKeys: function() { |
| 33 |
throw thrown; |
| 34 |
}, |
| 35 |
}) |
| 36 |
}; |
| 37 |
|
| 38 |
import('./2nd-param_FIXTURE.js', options) |
| 39 |
.then(function() { |
| 40 |
throw new Test262Error('Expected promise to be rejected, but promise was fulfilled.'); |
| 41 |
}, function(error) { |
| 42 |
assert.sameValue(error, thrown); |
| 43 |
}) |
| 44 |
.then($DONE, $DONE); |