mm_machine 3.0.1 → 3.0.3

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/package.json +1 -1
  2. package/registry.js +5 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mm_machine",
3
- "version": "3.0.1",
3
+ "version": "3.0.3",
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": {
package/registry.js CHANGED
@@ -100,8 +100,11 @@ Registry.prototype.getClass = function (class_name) {
100
100
  * @throws {Error} 模块配置项错误
101
101
  */
102
102
  Registry.prototype.registerModule = function (config) {
103
- if (!config || !config.name) {
104
- throw new TypeError('模块配置和模块名称不能为空');
103
+ if (!config) {
104
+ throw new TypeError('模块配置不能为空');
105
+ }
106
+ if (!config.name) {
107
+ throw new TypeError('模块名称不能为空');
105
108
  }
106
109
  var class_name = config.class_name || 'Drive';
107
110
  this._module_cache[config.name] = {