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

[Fix] raise an error when a method name is in string form #2513

Closed
wants to merge 1 commit into from
Closed

[Fix] raise an error when a method name is in string form #2513

wants to merge 1 commit into from

Conversation

shijistar
Copy link
Contributor

I got a compiling error when a component method name is in string form, but not an identifier. The sample code is,

class MyComponent {
    "special-method-name"() {
        // ...
    }
}

Normally method names should be valid identifiers, but for some reason, I need one of my methods in a special form. However any strings should be valid method name and both babel and Chrome run without any problem.

The difference between Identifier and String method is that the node.key.type is Identifier/Literal. So I made a special process here.

@shijistar shijistar closed this Dec 6, 2019
@ljharb
Copy link
Member

ljharb commented Dec 6, 2019

Duplicate of #2514. it seems.

@shijistar
Copy link
Contributor Author

Duplicate of #2514. it seems.

Yes, it's duplicated, and this PR should be ignored.

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

Successfully merging this pull request may close these issues.

None yet

2 participants