Comparing version 0.3.0-beta-3 to 0.3.0-beta-4
@@ -66,3 +66,3 @@ // Generated by CoffeeScript 1.8.0 | ||
if (registeredAt === 'local') { | ||
if (this._instances[name] == null) { | ||
if (!this._isInstantiated(name)) { | ||
this._instantiate(name); | ||
@@ -76,2 +76,6 @@ } | ||
Container.prototype._isInstantiated = function(name) { | ||
return Object.keys(this._instances).indexOf(name) !== -1; | ||
}; | ||
Container.prototype._registeredAt = function(name) { | ||
@@ -114,3 +118,3 @@ var p, parentIndex, _i, _len, _ref; | ||
return function(name) { | ||
if (_this._instances[name] == null) { | ||
if (!_this._isInstantiated(name)) { | ||
return _this._instantiate(name); | ||
@@ -150,3 +154,7 @@ } | ||
if (registeredAt === 'local') { | ||
return _this._instances[depName] || _this._instantiate(depName, name); | ||
if (_this._isInstantiated(depName)) { | ||
return _this._instances[depName]; | ||
} else { | ||
return _this._instantiate(depName, name); | ||
} | ||
} else if (registeredAt != null) { | ||
@@ -153,0 +161,0 @@ return _this._parents[registeredAt].get(depName); |
{ | ||
"name": "amend", | ||
"version": "0.3.0-beta-3", | ||
"version": "0.3.0-beta-4", | ||
"description": "Dependency injection module and IoC container.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
21313
299