Bug 1892041 - Part 2: Update test262. r=spidermonkey-reviewers,dminor
[gecko.git] / js / src / tests / test262 / language / module-code / verify-dfs.js
blob59432db45f9f003afbda9a744f48265e4fd28a52
1 // |reftest| module async
2 // Copyright (C) 2020 Ecma International. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
5 /*---
6 description: Dynamic import can't preempt DFS evaluation order
7 esid: sec-moduleevaluation
8 info: |
9   Evaluate ( ) Concrete Method
11   1. Assert: This call to Evaluate is not happening at the same time as another call to Evaluate within the surrounding agent.
12   [...]
13 flags: [module, async]
14 features: [dynamic-import]
15 ---*/
17 import './verify-dfs-a_FIXTURE.js';
18 import './verify-dfs-b_FIXTURE.js';
20 // rely on function hoisting to create shared array
21 export function evaluated(name) {
22   if (!evaluated.order) {
23     evaluated.order = [];
24   }
25   evaluated.order.push(name);
28 export function check(promise) {
29   promise.then(() => {
30     assert.sameValue(evaluated.order.length, 2);
31     assert.sameValue(evaluated.order[0], 'A');
32     assert.sameValue(evaluated.order[1], 'B');
33   })
34   .then($DONE, $DONE);