Skip to content

Commit

Permalink
Merge branch 'release/1.1.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis Rechkunov committed Jun 7, 2015
2 parents da431ad + 2b9854c commit d8a7844
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions lib/ServiceLocator.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ var DEPENDENCY_REGEXP = /^\$\w+/,
* @constructor
*/
function ServiceLocator() {
this._registrations = {};
this._registrations = Object.create(null);
}

/**
Expand Down Expand Up @@ -162,7 +162,7 @@ ServiceLocator.prototype.unregister = function (type) {
* @param {ServiceLocator} context Context of execution.
*/
function initializeRegistration(type, context) {
if (!context._registrations.hasOwnProperty(type)) {
if (!(type in context._registrations)) {
context._registrations[type] = [];
}
}
Expand All @@ -173,8 +173,7 @@ function initializeRegistration(type, context) {
* @param {string} type Type to check.
*/
function throwIfNoType(registrations, type) {
if (!registrations.hasOwnProperty(type) ||
registrations[type].length === 0) {
if (!(type in registrations) || registrations[type].length === 0) {
throw new Error(util.format(ERROR_TYPE_NOT_REGISTERED, type));
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "catberry-locator",
"version": "1.1.4",
"version": "1.1.5",
"author": "Denis Rechkunov <[email protected]>",
"description": "Service Locator component for Catberry Framework",
"homepage": "https://github.com/catberry/catberry-locator",
Expand Down

0 comments on commit d8a7844

Please sign in to comment.