| // 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); |