diff --git a/lib/container/ContainerEntryModule.js b/lib/container/ContainerEntryModule.js index e592ce480..647118088 100644 --- a/lib/container/ContainerEntryModule.js +++ b/lib/container/ContainerEntryModule.js @@ -217,10 +217,8 @@ class ContainerEntryModule extends Module { ])};`, `var init = ${runtimeTemplate.basicFunction("shareScope, initScope", [ `if (!${RuntimeGlobals.shareScopeMap}) return;`, - `var oldScope = ${RuntimeGlobals.shareScopeMap}[${JSON.stringify( - this._shareScope - )}];`, `var name = ${JSON.stringify(this._shareScope)}`, + `var oldScope = ${RuntimeGlobals.shareScopeMap}[name];`, `if(oldScope && oldScope !== shareScope) throw new Error("Container initialization failed as it has already been initialized with a different share scope");`, `${RuntimeGlobals.shareScopeMap}[name] = shareScope;`, `return ${RuntimeGlobals.initializeSharing}(name, initScope);`