bug1693261.js (897B)
1 // |reftest| skip-if(!xulRuntime.shell) module async -- needs drainJobQueue 2 3 import "./bug1693261-c1.mjs"; 4 import "./bug1693261-c2.mjs"; 5 import "./bug1693261-x.mjs"; 6 if (globalThis.testArray === undefined) { 7 globalThis.testArray = []; 8 } 9 globalThis.testArray.push("index"); 10 11 function assertEqArray(actual, expected) { 12 if (actual.length != expected.length) { 13 throw new Error( 14 "array lengths not equal: got " + 15 JSON.stringify(actual) + ", expected " + JSON.stringify(expected)); 16 } 17 18 for (var i = 0; i < actual.length; ++i) { 19 if (actual[i] != expected[i]) { 20 throw new Error( 21 "arrays not equal at element " + i + ": got " + 22 JSON.stringify(actual) + ", expected " + JSON.stringify(expected)); 23 } 24 } 25 } 26 27 assertEqArray(globalThis.testArray, [ 28 'async 1', 'async 2', 'c1', 'c2', 'x', 'index' 29 ]) 30 31 drainJobQueue(); 32 if (typeof reportCompare === "function") 33 reportCompare(true, true);