Debian Codegraph @

js/src/tests/test262/language/expressions/dynamic-import/import-attributes/2nd-param-evaluation-sequence.js

raw
1 // |reftest| shell-option(--enable-import-attributes) skip-if(!xulRuntime.shell) -- 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: Evaluates parameters in correct sequence
6 esid: sec-import-call-runtime-semantics-evaluation
7 info: |
8 2.1.1.1 EvaluateImportCall ( specifierExpression [ , optionsExpression ] )
9 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
10 2. Let specifierRef be the result of evaluating specifierExpression.
11 3. Let specifier be ? GetValue(specifierRef).
12 4. If optionsExpression is present, then
13 a. Let optionsRef be the result of evaluating optionsExpression.
14 b. Let options be ? GetValue(optionsRef).
15 [...]
16 features: [dynamic-import, import-attributes]
17 ---*/
18
19 var log = [];
20
21 import(log.push('first'), (log.push('second'), undefined))
22 .then(null, function() {});
23
24 assert.sameValue(log.length, 2);
25 assert.sameValue(log[0], 'first');
26 assert.sameValue(log[1], 'second');
27
28 reportCompare(0, 0);