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

View File

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