Skip to content

Commit

Permalink
correctly reset container cache
Browse files Browse the repository at this point in the history
  • Loading branch information
bekzod committed Oct 6, 2017
1 parent a20a784 commit de50b87
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/container/lib/container.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,10 @@ Container.prototype = {
@param {String} fullName optional key to reset; if missing, resets everything
*/
reset(fullName) {
if (fullName !== undefined) {
resetMember(this, this.registry.normalize(fullName));
} else {
if (fullName === undefined) {
resetCache(this);
} else {
resetMember(this, this.registry.normalize(fullName));
}
},

Expand Down Expand Up @@ -375,7 +375,8 @@ function destroyDestroyables(container) {

function resetCache(container) {
destroyDestroyables(container);
container.cache.dict = dictionary(null);
container.cache = dictionary(null);
container.factoryManagerCache = dictionary(null);
}

function resetMember(container, fullName) {
Expand Down

0 comments on commit de50b87

Please sign in to comment.