eval-rqstd-once.js (1045B)
1 // |reftest| async 2 // Copyright (C) 2018 Rick Waldron. All rights reserved. 3 // This code is governed by the BSD license found in the LICENSE file. 4 5 /*--- 6 description: Requested modules are evaluated exactly once 7 esid: sec-moduleevaluation 8 info: | 9 [...] 10 4. If module.[[Evaluated]] is true, return undefined. 11 5. Set module.[[Evaluated]] to true. 12 6. For each String required that is an element of module.[[RequestedModules]] do, 13 a. Let requiredModule be ? HostResolveImportedModule(module, required). 14 b. Perform ? requiredModule.ModuleEvaluation(). 15 [...] 16 includes: [fnGlobalObject.js] 17 flags: [async] 18 features: [dynamic-import] 19 ---*/ 20 21 var global = fnGlobalObject(); 22 23 Promise.all([ 24 import('./eval-rqstd-once_FIXTURE.js'), 25 import('./eval-rqstd-once_FIXTURE.js'), 26 ]).then(async () => { 27 // Use await to serialize imports 28 await import('./eval-rqstd-once_FIXTURE.js'); 29 await import('./eval-rqstd-once_FIXTURE.js'); 30 31 assert.sameValue(global.test262, 262, 'global property was defined'); 32 }).then($DONE, $DONE);