Skip to content

Commit 78f9c41

Browse files
committed
Fixed bug causing plugins to be executed more than once if listed multiple times w/initializePlugins.
1 parent f211ef4 commit 78f9c41

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/microplugin.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,18 +74,19 @@
7474
}
7575

7676
while (queue.length) {
77-
self.loadPlugin(queue.shift());
77+
self.require(queue.shift());
7878
}
7979
};
8080

8181
Interface.prototype.loadPlugin = function(name) {
82-
if (!Interface.plugins.hasOwnProperty(name)) {
83-
throw new Error('Unable to find "' + name + '" plugin');
84-
}
8582
var self = this;
8683
var plugins = self.plugins;
8784
var plugin = Interface.plugins[name];
8885

86+
if (!Interface.plugins.hasOwnProperty(name)) {
87+
throw new Error('Unable to find "' + name + '" plugin');
88+
}
89+
8990
plugins.requested[name] = true;
9091
plugins.loaded[name] = plugin.fn.apply(self, [self.plugins.settings[name] || {}]);
9192
plugins.names.push(name);

0 commit comments

Comments
 (0)