Skip to content
This repository has been archived by the owner on Mar 15, 2019. It is now read-only.

[doc] Common error, forgetting _super in included #11

Open
mike-north opened this issue Jul 30, 2018 · 6 comments
Open

[doc] Common error, forgetting _super in included #11

mike-north opened this issue Jul 30, 2018 · 6 comments

Comments

@mike-north
Copy link

mike-north commented Jul 30, 2018

Over the past couple of weeks, I've worked with a few people to get JS decorators working in existing ember addons. The most common setup snag that people hit was forgetting to call this._super in an existing included() hook.

We may want to add a note about this in the docs, to ensure that getting set up is as easy as possible.

@rwjblue
Copy link
Contributor

rwjblue commented Jul 30, 2018

Ya, we can even check their index.js upon installation to confirm...

@pzuraq
Copy link
Collaborator

pzuraq commented Jul 30, 2018

👍 all for adding it, it should be this._super.included.apply(this, arguments) though right? Or this._super.included(...arguments) if that is within the node version range we intend to support. I've been bitten by that one before as well.

@mike-north
Copy link
Author

mike-north commented Jul 30, 2018

I only meant to point out the need to call _super.

@dfreeman
Copy link
Contributor

this._super.included.apply(this, arguments) is semantically different from this._super.included(...arguments) — the latter winds up with the super fn as this, so I believe it'll need to be the former regardless of spread support

@BryanCrotaz
Copy link

can this be added to the ember linting?

@buschtoens
Copy link
Collaborator

I think the eslint-plugin-ember is only for js source files that get bundled into the app, and not for node source files. :/

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

No branches or pull requests

6 participants