Skip to content

Commit

Permalink
Remove the usage of resolver as function in registry
Browse files Browse the repository at this point in the history
  • Loading branch information
gowtham-mk-2280 committed Dec 1, 2017
1 parent 1723b73 commit f37b492
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 29 deletions.
13 changes: 0 additions & 13 deletions packages/container/lib/registry.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ export default class Registry {
this.fallback = options.fallback || null;
this.resolver = options.resolver || null;

if (typeof this.resolver === 'function') {
deprecateResolverFunction(this);
}

this.registrations = dictionary(options.registrations || null);

this._typeInjections = dictionary(null);
Expand Down Expand Up @@ -602,15 +598,6 @@ export default class Registry {
}
}

function deprecateResolverFunction(registry) {
deprecate(
'Passing a `resolver` function into a Registry is deprecated. Please pass in a Resolver object with a `resolve` method.',
false,
{ id: 'ember-application.registry-resolver-as-function', until: '3.0.0', url: 'https://emberjs.com/deprecations/v2.x#toc_registry-resolver-as-function' }
);
registry.resolver = { resolve: registry.resolver };
}

if (DEBUG) {
Registry.prototype.normalizeInjectionsHash = function(hash) {
let injections = [];
Expand Down
16 changes: 0 additions & 16 deletions packages/container/tests/registry_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -473,22 +473,6 @@ QUnit.test('`knownForType` is called on the resolver if present', function() {
});
});

QUnit.test('A registry can be created with a deprecated `resolver` function instead of an object', function() {
expect(2);

let registry;

expectDeprecation(() => {
registry = new Registry({
resolver(fullName) {
return `${fullName}-resolved`;
}
});
}, 'Passing a `resolver` function into a Registry is deprecated. Please pass in a Resolver object with a `resolve` method.');

equal(registry.resolve('foo:bar'), 'foo:bar-resolved', '`resolve` still calls the deprecated function');
});

QUnit.test('resolver.expandLocalLookup is not required', function(assert) {
assert.expect(1);

Expand Down

0 comments on commit f37b492

Please sign in to comment.