mirror of
https://github.com/tc39/test262.git
synced 2025-12-04 20:43:10 +01:00
19 lines
604 B
Plaintext
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);
|