Skip to content
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

disallow import root during validation #430

Merged
merged 1 commit into from
Apr 2, 2017
Merged

Conversation

Conduitry
Copy link
Member

That the root context is called root is ingrained pretty deeply, and it seems difficult to deconflict this with an import of root. So for now it's probably best to simply disallow this entirely during validation.

@Rich-Harris Rich-Harris merged commit 132de5c into master Apr 2, 2017
@Rich-Harris Rich-Harris deleted the disallow-import-root branch April 2, 2017 12:35
@Rich-Harris
Copy link
Member

This seems like a good precaution. Is there any place where generated code would come into contact with that though? root is only ever a parameter in generated code, so it shouldn't matter if it shadows an import since that's only referenced inside the template IIFE, no?

@Conduitry
Copy link
Member Author

Well this could come up if an import root was being used as a nested component. Then with the recent change to use imported components directly instead of via template.components, there would be a reference to that outside of the template IIFE. It's a bizarre case, and right now I can't think of another way it might come up.

@Rich-Harris
Copy link
Member

Ah, of course. Forgot about that case.

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