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

Support optional chaining #8

Closed
Conduitry opened this issue Jun 11, 2020 · 1 comment
Closed

Support optional chaining #8

Conduitry opened this issue Jun 11, 2020 · 1 comment

Comments

@Conduitry
Copy link

ES2020's optional chaining brings some additions to the AST that will need to be addressed here (and in code-red) before they can be supported in Svelte.

The PR estree/estree#204 has not been merged yet but the spec apparently is final. Roughly, there's a new ChainExpression type that only has an expression key, and it's this expression that contains the chain of member and call expressions with a new optional boolean on each one.

Before this can be done properly, we might need to wait for @types/estree to be released.

@Conduitry
Copy link
Author

Digging more into what this library is doing, I'm beginning to think there isn't any work here to do. The only place where we're specially interacting with MemberExpressions is in extracting identifiers/names from variable declarations and function parameters, and ChainExpressions can't occur there in a way that would affect us.

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

No branches or pull requests

1 participant