test262/src/dynamic-import/eval-script-code-host-resolves-module-code.case

19 lines
604 B
Plaintext

// Copyright (C) 2018 Leo Balter. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: import() from a script code can load a file with module code
template: default
---*/
//- setup
// This is still valid in script code, and should not be valid for module code
// https://tc39.github.io/ecma262/#sec-scripts-static-semantics-lexicallydeclarednames
var smoosh; function smoosh() {}
//- import
import('./module-code_FIXTURE.js')
//- body
assert.sameValue(imported.default, 42);
assert.sameValue(imported.x, 'Test262');
assert.sameValue(imported.z, 42);