Skip to content

Commit

Permalink
Remove arity check from initializer
Browse files Browse the repository at this point in the history
  • Loading branch information
locks committed Dec 20, 2017
1 parent b19c4f7 commit 73b76d6
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions packages/ember-application/lib/system/engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
privatize as P
} from 'container';
import DAG from 'dag-map';
import { assert, deprecate } from 'ember-debug';
import { assert } from 'ember-debug';
import { get, set } from 'ember-metal';
import DefaultResolver from './resolver';
import EngineInstance from './engine-instance';
Expand Down Expand Up @@ -124,18 +124,7 @@ const Engine = Namespace.extend(RegistryProxyMixin, {
runInitializers() {
this._runInitializer('initializers', (name, initializer) => {
assert(`No application initializer named '${name}'`, !!initializer);
if (initializer.initialize.length === 2) {
deprecate(`The \`initialize\` method for Application initializer '${name}' should take only one argument - \`App\`, an instance of an \`Application\`.`,
false, {
id: 'ember-application.app-initializer-initialize-arguments',
until: '3.0.0',
url: 'https://emberjs.com/deprecations/v2.x/#toc_initializer-arity'
});

initializer.initialize(this.__registry__, this);
} else {
initializer.initialize(this);
}
initializer.initialize(this);
});
},

Expand Down Expand Up @@ -474,7 +463,7 @@ function resolverFor(namespace) {
}

function buildInitializerMethod(bucketName, humanName) {
return function(initializer) {
return function (initializer) {
// If this is the first initializer being added to a subclass, we are going to reopen the class
// to make sure we have a new `initializers` object, which extends from the parent class' using
// prototypal inheritance. Without this, attempting to add initializers to the subclass would
Expand Down

0 comments on commit 73b76d6

Please sign in to comment.