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

[parser] Allow optional async methods #10582

Merged
merged 2 commits into from Nov 18, 2019
Merged

[parser] Allow optional async methods #10582

merged 2 commits into from Nov 18, 2019

Conversation

zant
Copy link
Contributor

@zant zant commented Oct 21, 2019

Q                       A
Fixed Issues? Fixes #10525
Patch: Bug Fix? Yes
Major: Breaking Change? No
Minor: New Feature? No
Tests Added + Pass? Yes
Any Dependency Changes? No
License MIT

async methods were not parsing post member name modifiers, causing ? to be an unexpected token

Copy link
Contributor

@JLHwung JLHwung left a comment

Choose a reason for hiding this comment

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

This PR also reveals an issue in modifiers parsing. i.e. the following snippet

class B { }
class A extends B {
    async? method(val: string): Promise<void>;
}

is expected to throw but currently it is parsed as an optional async method signature. We could address it in a separate PR, though.

@existentialism existentialism added pkg: parser PR: Bug Fix 🐛 A type of pull request used for our changelog categories labels Oct 21, 2019
@zant
Copy link
Contributor Author

zant commented Oct 21, 2019

Oh that's right @JLHwung I'll be glad to work on a follow-up PR for that 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: parser PR: Bug Fix 🐛 A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

babel-preset-typescript failed to parse optional async method
4 participants