diff --git a/test/language/module-code/dynamic-import/eval-rqstd-abrupt-err-type_FIXTURE.js b/test/language/module-code/dynamic-import/eval-rqstd-abrupt-err-type_FIXTURE.js deleted file mode 100644 index 13544ca36a..0000000000 --- a/test/language/module-code/dynamic-import/eval-rqstd-abrupt-err-type_FIXTURE.js +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (C) 2016 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -throw new TypeError(); diff --git a/test/language/module-code/dynamic-import/eval-rqstd-abrupt.js b/test/language/module-code/dynamic-import/eval-rqstd-abrupt.js deleted file mode 100644 index 5548b47568..0000000000 --- a/test/language/module-code/dynamic-import/eval-rqstd-abrupt.js +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (C) 2018 Rick Waldron. All rights reserved. -// Copyright (C) 2016 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: > - Abrupt completion during module evaluation precludes further evaluation -esid: sec-moduleevaluation -info: | - [...] - 6. For each String required that is an element of - module.[[RequestedModules]] do, - a. Let requiredModule be ? HostResolveImportedModule(module, required). - b. Perform ? requiredModule.ModuleEvaluation(). -flags: [async, module] -features: [dynamic-import] ----*/ - -import('./eval-rqstd-abrupt-err-type_FIXTURE.js').then($DONE, error => { - // negative: - // phase: runtime - // type: TypeError - assert.sameValue(error instanceof TypeError, true); -}).then($DONE, $DONE).catch($DONE); diff --git a/test/language/module-code/dynamic-import/eval-rqstd-once.js b/test/language/module-code/dynamic-import/eval-rqstd-once.js index ca1a910122..997f71a961 100644 --- a/test/language/module-code/dynamic-import/eval-rqstd-once.js +++ b/test/language/module-code/dynamic-import/eval-rqstd-once.js @@ -1,5 +1,6 @@ -// Copyright (C) 2016 the V8 project authors. All rights reserved. +// Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. + /*--- description: Requested modules are evaluated exactly once esid: sec-moduleevaluation @@ -12,20 +13,19 @@ info: | b. Perform ? requiredModule.ModuleEvaluation(). [...] includes: [fnGlobalObject.js] -flags: [async, module] +flags: [async] features: [dynamic-import] ---*/ var global = fnGlobalObject(); - - Promise.all([ import('./eval-rqstd-once_FIXTURE.js'), import('./eval-rqstd-once_FIXTURE.js'), - import('./eval-rqstd-once_FIXTURE.js'), -]).then((...importeds) => { +]).then(async () => { + // Use await to serialize imports + await import('./eval-rqstd-once_FIXTURE.js'); + await import('./eval-rqstd-once_FIXTURE.js'); assert.sameValue(global.test262, 262, 'global property was defined'); - }).then($DONE, $DONE); diff --git a/test/language/module-code/dynamic-import/eval-self-once.js b/test/language/module-code/dynamic-import/eval-self-once.js index 2dbaf6e818..28cb8544c6 100644 --- a/test/language/module-code/dynamic-import/eval-self-once.js +++ b/test/language/module-code/dynamic-import/eval-self-once.js @@ -1,4 +1,4 @@ -// Copyright (C) 2018 the V8 project authors. All rights reserved. +// Copyright (C) 2018 Rick Waldron. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- description: Module is evaluated exactly once @@ -12,7 +12,7 @@ info: | b. Perform ? requiredModule.ModuleEvaluation(). [...] includes: [fnGlobalObject.js] -flags: [async,module] +flags: [async] features: [dynamic-import] ---*/ @@ -27,6 +27,10 @@ global.evaluated++; Promise.all([ import('./eval-self-once.js'), import('./eval-self-once.js'), -]).then((...importeds) => { +]).then(async () => { + // Use await to serialize imports + await import('./eval-self-once.js'); + await import('./eval-self-once.js'); + assert.sameValue(global.evaluated, 1, 'global property was defined and incremented only once'); }).then($DONE, $DONE); diff --git a/test/language/module-code/dynamic-import/instn-iee-err-ambiguous-1_FIXTURE.js b/test/language/module-code/dynamic-import/instn-iee-err-ambiguous-1_FIXTURE.js deleted file mode 100644 index 896bdff50a..0000000000 --- a/test/language/module-code/dynamic-import/instn-iee-err-ambiguous-1_FIXTURE.js +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (C) 2016 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -export var x; diff --git a/test/language/module-code/dynamic-import/instn-iee-err-ambiguous-2_FIXTURE.js b/test/language/module-code/dynamic-import/instn-iee-err-ambiguous-2_FIXTURE.js deleted file mode 100644 index 896bdff50a..0000000000 --- a/test/language/module-code/dynamic-import/instn-iee-err-ambiguous-2_FIXTURE.js +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (C) 2016 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -export var x; diff --git a/test/language/module-code/dynamic-import/instn-iee-err-ambiguous-export.js b/test/language/module-code/dynamic-import/instn-iee-err-ambiguous-export.js deleted file mode 100644 index 19864dd427..0000000000 --- a/test/language/module-code/dynamic-import/instn-iee-err-ambiguous-export.js +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (C) 2016 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: IndirectExportEntries validation - ambiguous imported bindings -esid: sec-moduledeclarationinstantiation -info: | - [...] - 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do - a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). - b. If resolution is null or resolution is "ambiguous", throw a - SyntaxError exception. - [...] - - 15.2.1.16.3 ResolveExport - - [...] - 9. Let starResolution be null. - 10. For each ExportEntry Record e in module.[[StarExportEntries]], do - a. Let importedModule be ? HostResolveImportedModule(module, - e.[[ModuleRequest]]). - b. Let resolution be ? importedModule.ResolveExport(exportName, - resolveSet, exportStarSet). - c. If resolution is "ambiguous", return "ambiguous". - d. If resolution is not null, then - i. If starResolution is null, let starResolution be resolution. - ii. Else, - 1. Assert: there is more than one * import that includes the - requested name. - 2. If resolution.[[Module]] and starResolution.[[Module]] are - not the same Module Record or - SameValue(resolution.[[BindingName]], - starResolution.[[BindingName]]) is false, return "ambiguous". -negative: - phase: runtime - type: SyntaxError -flags: [module] ----*/ - -export { x } from './instn-iee-err-ambiguous_FIXTURE.js'; diff --git a/test/language/module-code/dynamic-import/instn-iee-err-ambiguous_FIXTURE.js b/test/language/module-code/dynamic-import/instn-iee-err-ambiguous_FIXTURE.js deleted file mode 100644 index 7857161c3a..0000000000 --- a/test/language/module-code/dynamic-import/instn-iee-err-ambiguous_FIXTURE.js +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright (C) 2016 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -export * from './instn-iee-err-ambiguous-1_FIXTURE.js'; -export * from './instn-iee-err-ambiguous-2_FIXTURE.js'; diff --git a/test/language/module-code/dynamic-import/dynamic-import-module_FIXTURE.js b/test/language/module-code/dynamic-import/usage/dynamic-import-module_FIXTURE.js similarity index 100% rename from test/language/module-code/dynamic-import/dynamic-import-module_FIXTURE.js rename to test/language/module-code/dynamic-import/usage/dynamic-import-module_FIXTURE.js