2nd-param-evaluation-sequence.js (986B)
1 // Copyright (C) 2021 the V8 project authors. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 /*--- 4 description: Evaluates parameters in correct sequence 5 esid: sec-import-call-runtime-semantics-evaluation 6 info: | 7 2.1.1.1 EvaluateImportCall ( specifierExpression [ , optionsExpression ] ) 8 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 9 2. Let specifierRef be the result of evaluating specifierExpression. 10 3. Let specifier be ? GetValue(specifierRef). 11 4. If optionsExpression is present, then 12 a. Let optionsRef be the result of evaluating optionsExpression. 13 b. Let options be ? GetValue(optionsRef). 14 [...] 15 features: [dynamic-import, import-attributes] 16 ---*/ 17 18 var log = []; 19 20 import(log.push('first'), (log.push('second'), undefined)) 21 .then(null, function() {}); 22 23 assert.sameValue(log.length, 2); 24 assert.sameValue(log[0], 'first'); 25 assert.sameValue(log[1], 'second'); 26 27 reportCompare(0, 0);