Skip to content

Commit b854db4

Browse files
authored
Merge pull request #14774 from tanhauhau/tanhauhau/reuse-name-variable-in-shared-scope
reuse name variable in share scope
2 parents 3eff82d + 4ed2ecf commit b854db4

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

lib/container/ContainerEntryModule.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,8 @@ class ContainerEntryModule extends Module {
220220
])};`,
221221
`var init = ${runtimeTemplate.basicFunction("shareScope, initScope", [
222222
`if (!${RuntimeGlobals.shareScopeMap}) return;`,
223-
`var oldScope = ${RuntimeGlobals.shareScopeMap}[${JSON.stringify(
224-
this._shareScope
225-
)}];`,
226223
`var name = ${JSON.stringify(this._shareScope)}`,
224+
`var oldScope = ${RuntimeGlobals.shareScopeMap}[name];`,
227225
`if(oldScope && oldScope !== shareScope) throw new Error("Container initialization failed as it has already been initialized with a different share scope");`,
228226
`${RuntimeGlobals.shareScopeMap}[name] = shareScope;`,
229227
`return ${RuntimeGlobals.initializeSharing}(name, initScope);`

0 commit comments

Comments
 (0)