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

[BUGFIX release] Update deprecation wording in init. #37

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions core-object.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,18 @@ CoreObject.extend = function(options) {
if (options) {
if (shouldCallSuper(options.init)) {

// this._super.init && is to make sure that the deprecation message
// works for people who are writing addons supporting before 2.6.
deprecation(
'The addon `' + options.name + '` is overriding init without calling this._super. ' +
'This behaviour is deprecated. ' +
'This means that addon\'s author needs to update it calling `this._super.init && this._super.init.apply(this, arguments)` ' +
'and release a new version. ' +
'Do not worry, ember-cli is working normally.'
);
Copy link
Member

Choose a reason for hiding this comment

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

why is this only one deprecation message now instead of the two separate ones before?

Copy link
Author

Choose a reason for hiding this comment

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

The difference between them was how to solve it. Addressing this comment made them the same.

Copy link
Contributor

@stefanpenner stefanpenner Jun 20, 2016

Choose a reason for hiding this comment

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

This is too verbose (although I do appreciate the reasoning) so lets keep it short and instead link to shortened URL pointing to UPGRADE.MD or something in this repo.

if (hasArgs(options.init)) {
deprecation(
'Overriding init without calling this._super is deprecated. ' +
'Please call this._super(), addon: `' + options.name + '`'
);
options.init = forceSuperWithoutApply(options.init);
} else {

// this._super.init && is to make sure that the deprecation message
// works for people who are writing addons supporting before 2.6.
deprecation(
'Overriding init without calling this._super is deprecated. ' +
'Please call `this._super.init && this._super.init.apply(this, arguments);` addon: `' + options.name + '`'
);
options.init = forceSuper(options.init);
}
}
Expand Down