mm_machine 1.9.5 → 1.9.7

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/item.js +15 -3
  2. package/package.json +1 -1
package/item.js CHANGED
@@ -139,7 +139,15 @@ Item.prototype.remove_module = function(m) {
139
139
  * @param {String} file 文件
140
140
  */
141
141
  Item.prototype.unload_script = function(file) {
142
- this.remove_module(file || this.config.func_file.fullname(this.dir));
142
+ if (!file) {
143
+ var f = this.config.func_file;
144
+ if (f) {
145
+ file = f.fullname(this.dir)
146
+ }
147
+ }
148
+ if (file) {
149
+ this.remove_module(file);
150
+ }
143
151
  this.complete = false;
144
152
  }
145
153
 
@@ -197,7 +205,9 @@ Item.prototype.load_script = function(file, name = "") {
197
205
  cs = $.require(file, (cs, way) => {
198
206
  if (way == "change" && cs) {
199
207
  if (name) {
200
- this.main = cs[name];
208
+ if (cs[name]) {
209
+ this.main = cs[name];
210
+ }
201
211
  } else {
202
212
  $.push(this, cs, true);
203
213
  }
@@ -208,7 +218,9 @@ Item.prototype.load_script = function(file, name = "") {
208
218
  }
209
219
  if (cs) {
210
220
  if (name) {
211
- this.main = cs[name];
221
+ if (cs[name]) {
222
+ this.main = cs[name];
223
+ }
212
224
  } else {
213
225
  $.push(this, cs, true);
214
226
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mm_machine",
3
- "version": "1.9.5",
3
+ "version": "1.9.7",
4
4
  "description": "这是超级美眉框架机制构建辅助模块,用于快速构建一个机制",
5
5
  "main": "index.js",
6
6
  "scripts": {