mm_machine 2.7.0 → 2.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +4 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -241,7 +241,9 @@ Manager.prototype.sort = function () {
241
241
  * 清除所有模块
242
242
  */
243
243
  Manager.prototype.clearMods = function () {
244
- $.clear(this.mods);
244
+ for (let name in this.mods) {
245
+ delete this.mods[name];
246
+ }
245
247
  };
246
248
 
247
249
  /**
@@ -588,7 +590,7 @@ Manager.prototype._runMod = async function (mod, method, ...params) {
588
590
  $.log.error(`加载模块脚本失败: `, err);
589
591
  }
590
592
  }
591
-
593
+
592
594
  // 执行方法
593
595
  let ret = await mod.call(method, ...params);
594
596
  // 根据模式决定是否重载
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mm_machine",
3
- "version": "2.7.0",
3
+ "version": "2.7.2",
4
4
  "description": "A flexible Node.js plugin mechanism system for dynamic loading, management and execution of modules. Supports hot reload, lifecycle management, and modern JavaScript features.",
5
5
  "main": "index.js",
6
6
  "scripts": {