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

support protected identifiers #22

Closed
flying-sheep opened this issue Dec 21, 2015 · 6 comments
Closed

support protected identifiers #22

flying-sheep opened this issue Dec 21, 2015 · 6 comments
Labels

Comments

@flying-sheep
Copy link

as it’s perfectly reasonable to do exports.default = foo, yet the transformed syntax is the illegal export var default = connect.default

probably coincides with #10, as the project in question was react-redux, which seems to be compiled with babel

@flying-sheep
Copy link
Author

another problem is that apparently acorn doesn’t handle comments in function declarations or so…

function compileMap(/* lists... */) {

raises unexpected in parseExprAtom. both were found via this hack: rollup/rollup#296 (comment)

isn’t there better parsers than acorn? e.g. babylon? i guess the first comment is wrong code generation, but this comment is probably a parser not coded to spec…

@Swatinem
Copy link

I’m also stumbled across this just now. The export var default = X.default trips up the rollup parser.

@flying-sheep
Copy link
Author

that should be handled in a special way anyway, since babel AFAIK started to translate it that way (with an explicit member “exports.default = ...“ instead of directly as “module.exports = ...”

@Rich-Harris
Copy link
Contributor

#16 fixes this – I've updated that branch in light of some more recent changes. @Victorystick if you get a chance to review it, should be good to merge?

@Rich-Harris
Copy link
Contributor

@flying-sheep that's... very odd. Acorn should parse that comment just fine. Are you able to reproduce that specific bug separately?

@Rich-Harris
Copy link
Contributor

I've released 2.1.0 with the fix. @flying-sheep I don't know if that parser error deserves a separate issue or if rollup/rollup#296 (comment) covers it? Either way I'll close this as it's unrelated to the reserved identifiers thing

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants