Comparing version 0.0.56 to 0.0.57
@@ -56,11 +56,3 @@ import { containerMark } from './constants.js'; | ||
case 'singleton': { | ||
const root = this.root; | ||
for (const child of root.children) { | ||
if (child.injections.has(token)) { | ||
targetContainer = child; | ||
Container.scoped = targetContainer; | ||
return targetContainer; | ||
} | ||
} | ||
targetContainer = this.root.extend(); | ||
targetContainer = this.root; | ||
Container.scoped = targetContainer; | ||
@@ -93,5 +85,3 @@ break; | ||
const targetContainer = this.resolveTargetContainer(token); | ||
const processTransitPath = token.scope === 'container' || | ||
token.scope === 'scoped' || | ||
token.scope === 'singleton'; | ||
const processTransitPath = token.scope === 'container' || token.scope === 'scoped'; | ||
let transitPathIndex; | ||
@@ -144,11 +134,6 @@ if (processTransitPath) { | ||
} | ||
let containerToSearch = this; | ||
switch (token.scope) { | ||
case 'singleton': { | ||
const root = this.root; | ||
for (const child of root.children) { | ||
const value = child.injections.get(token) ?? child.inheritInjections.get(token); | ||
if (value) { | ||
return value; | ||
} | ||
} | ||
containerToSearch = this.root; | ||
break; | ||
@@ -158,3 +143,3 @@ } | ||
case 'scoped': { | ||
for (const child of this.children) { | ||
for (const child of containerToSearch.children) { | ||
const value = child.injections.get(token) ?? child.inheritInjections.get(token); | ||
@@ -171,3 +156,4 @@ if (value) { | ||
} | ||
const value = this.injections.get(token) ?? this.inheritInjections.get(token); | ||
const value = containerToSearch.injections.get(token) ?? | ||
containerToSearch.inheritInjections.get(token); | ||
if (!value) { | ||
@@ -174,0 +160,0 @@ throw new Error('injection not found'); |
{ | ||
"name": "mobidic", | ||
"version": "0.0.56", | ||
"version": "0.0.57", | ||
"keywords": [], | ||
@@ -5,0 +5,0 @@ "author": "js2me", |
Sorry, the diff of this file is not supported yet
47650
884