优化插件模块

This commit is contained in:
Harvey Zack committed 2019-06-25 16:59:27 +08:00
1 parent 98f0e80a33
commit 47058616de
3 files changed
+14 -4

No files matched your search

+4 -1
View File
@@ -4217,7 +4217,10 @@
pluginName = "plugin".concat(this.id);
}
this[pluginName] = result;
errorHandle(!hasOwnProperty(this, pluginName), "Cannot add a plugin that already has the same name: ".concat(pluginName));
Object.defineProperty(this, pluginName, {
value: result
});
this.art.emit('plugin:add', plugin);
return this;
}