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

Compiler doesn't validate usage of decorators on class fields #100

Closed
pmdartus opened this issue Feb 13, 2018 · 0 comments · Fixed by #101
Closed

Compiler doesn't validate usage of decorators on class fields #100

pmdartus opened this issue Feb 13, 2018 · 0 comments · Fixed by #101
Labels

Comments

@pmdartus
Copy link
Member

Description

Today the babel-plugin-transform-lwc-class throws when applying a decorator that is not imported to a class method.

export default class Test {
    @api
 // ^ Supported decorators (api, wire, track) should be imported from "engine"
    test() {}
}

But the same restriction doesn't get applied to properties. The following code passes compilation but doesn't work as expected at runtime.

export default class Test {
    @api test = false;
}
@pmdartus pmdartus added the bug label Feb 13, 2018
@pmdartus pmdartus changed the title Compiler doesn Compiler doesn't validate usage of decorators on class fields Feb 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant