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

[FEAT] Adds more assertions to native decorators, and parenless invocation #17604

Merged

Conversation

pzuraq
Copy link
Contributor

@pzuraq pzuraq commented Feb 11, 2019

This upstreams a couple of helpful assertions from ember-decorators,
and also adds the ability to call @service, @controller, and
@computed without parens (only in native)

@pzuraq pzuraq force-pushed the feat/decorator-assertions-and-parenless branch from ed9712d to 671231a Compare February 11, 2019 21:55
`Only one computed property decorator can be applied to a class field or accessor, but '${key}' was decorated twice. You may have added the decorator to both a getter and setter, which is unecessary.`,
isClassicDecorator ||
!propertyDesc.get ||
!propertyDesc.get.toString().includes('CPGETTER_FUNCTION')
Copy link
Member

Choose a reason for hiding this comment

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

This relies on String.prototype.includes, is that available on IE11?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah, good point, will switch to indexof

@pzuraq pzuraq force-pushed the feat/decorator-assertions-and-parenless branch 2 times, most recently from b5cd71b to d2c8ffb Compare February 12, 2019 21:30
…ation

This upstreams a couple of helpful assertions from ember-decorators,
and also adds the ability to call `@service`, `@controller`, and
`@computed` without parens.
@pzuraq pzuraq force-pushed the feat/decorator-assertions-and-parenless branch from d2c8ffb to 095cdd8 Compare February 12, 2019 22:03
@rwjblue rwjblue merged commit 89b122a into emberjs:master Feb 13, 2019
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