You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var acorn = require("acorn");
// SyntaxError: Unexpected token (1:9)
acorn.parse('export { var } from "foo/bar.js";', {
sourceType: "module"
});
I believe that this code should work. I am basing that upon three things:
Exporting/importing reserved words works fine:
acorn.parse('export { foo as var };', {
sourceType: "module"
});
acorn.parse('import { var as foo } from "foo/bar.js";', {
sourceType: "module"
});
It is only re-exporting that breaks.
I'm not an expert on the ES spec, but based upon the spec for ES2017, they seem to allow for IdentifierName with re-exports, therefore reserved words should be okay.
This is actually causing problems for me because I'm trying to integrate PureScript with Rollup (which uses acorn), but PureScript generates imports/exports which are reserved words.
The text was updated successfully, but these errors were encountered:
I am using acorn version 4.0.4 from npm.
Here is the code which is failing:
I believe that this code should work. I am basing that upon three things:
Exporting/importing reserved words works fine:
It is only re-exporting that breaks.
I'm not an expert on the ES spec, but based upon the spec for ES2017, they seem to allow for
IdentifierName
with re-exports, therefore reserved words should be okay.Some other people have said that it's okay.
This is actually causing problems for me because I'm trying to integrate PureScript with Rollup (which uses acorn), but PureScript generates imports/exports which are reserved words.
The text was updated successfully, but these errors were encountered: