Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

import() is available in Script goal #18

Closed
bmeck opened this issue Aug 11, 2017 · 1 comment
Closed

import() is available in Script goal #18

bmeck opened this issue Aug 11, 2017 · 1 comment
Labels

Comments

@bmeck
Copy link

bmeck commented Aug 11, 2017

As per the grammar in https://tc39.github.io/proposal-dynamic-import/#prod-ImportCall . import() is available in all contexts (Script and Module alike). The following throws an error where it should not.

// entry.js
require('@std/esm');
require('./a');
// a.js
import('./b');
// b.mjs
// this space left blank
$ node entry.js
/Users/bfarias/Documents/tmp/app/a.js:1
(function (exports, require, module, __filename, __dirname) { import('./b');
@jdalton
Copy link
Member

jdalton commented Aug 11, 2017

Thanks @bmeck!

Yep, we have some tests for this, in the compiler at least. I'll look into what we missed in the wiring.

@jdalton jdalton added the bug label Aug 13, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

2 participants