Skip to content

Support Export Statements - WIP #78

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

Support Export Statements - WIP #78

wants to merge 2 commits into from

Conversation

Cmdv
Copy link

@Cmdv Cmdv commented Sep 7, 2018

this is linked to #71

Again I'm a little unsure about everything this currently covers as from the specs there are all these too:

export { variable1 as name1, variable2 as name2, …, nameN };
export let name1, name2, …, nameN; // also var, const
export let name1 = …, name2 = …, …, nameN; // also var, const
export class ClassName {...}
export default expression;
export default function name1(…) { … } // also class, function*
export { name1 as default, … };

export * from …;
export { name1, name2, …, nameN } from …;
export { import1 as name1, import2 as name2, …, nameN } from …;
export { default } from …;

So I'm missing things like from + * etc.

@erikd
Copy link
Owner

erikd commented Sep 7, 2018

Incomplete support is better than no support, as long as it passes all existing and new tests.

@Cmdv
Copy link
Author

Cmdv commented Sep 7, 2018

I'll need to look into this a lot more as in all honesty I took what was in the original PR and just ported the parts I needed to these individual PRs.

I'll have a better look see if I can get as much implemented as I can. I understand you might not have the time to help so if anything at least I might have done some of the work towards implementing these and someone else can pick up 😄

@Cmdv Cmdv changed the title Support Export Statements Support Export Statements - WIP Sep 7, 2018
@@ -60,6 +60,7 @@ fixStmt a s (JSMethodCall e _ args _ _) = JSMethodCall (fix a e) emptyAnnot (fix
fixStmt a s (JSReturn _ me _) = JSReturn a (fixSpace me) s
fixStmt a s (JSSwitch _ _ e _ _ sps _ _) = JSSwitch a emptyAnnot (fixEmpty e) emptyAnnot emptyAnnot (fixSwitchParts sps) emptyAnnot s
fixStmt a s (JSThrow _ e _) = JSThrow a (fixSpace e) s
fixStmt a s (JSExport _ df x1 _) = JSExport a (fixSpace df) (fixEmpty x1) s -- unsure what I'm doing here
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think I'm just doing a lot of guess work right now, not sure what needs to be done here

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is why we have minify tests, which minifys something and then tried to parse it. As long as that works correctly for all cases that can be pasrsed it should be fine.

@Cmdv
Copy link
Author

Cmdv commented Nov 21, 2018

feel free to close this as it looks like it was acheived in #80

@erikd erikd closed this Apr 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants