refactor: remove alreadyRequired which is always true

This commit is contained in:
Clark Du 2017-11-19 21:28:08 +08:00 committed by Pooya Parsa
parent b34abc7efe
commit 73509c29ba
1 changed files with 2 additions and 4 deletions

View File

@ -120,12 +120,10 @@ export default class ModuleContainer {
// If requireOnce specified & module from NPM or with specified name
if (requireOnce && name) {
const alreadyRequired = this.requiredModules.indexOf(name) !== -1
if (requireOnce && alreadyRequired) {
if (alreadyRequired) {
return
}
if (!alreadyRequired) {
this.requiredModules.push(name)
}
this.requiredModules.push(name)
}
// Call module with `this` context and pass options