efront 3.22.10 → 3.24.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 (39) hide show
  1. package/coms/basic/BigNumber.js +28 -5
  2. package/coms/basic/BigNumber_test.js +14 -1
  3. package/coms/basic/[]map.js +18 -13
  4. package/coms/basic/assert.js +10 -2
  5. package/coms/basic/extends_.js +13 -0
  6. package/coms/basic/loader.js +47 -28
  7. package/coms/basic/mark.js +155 -0
  8. package/coms/basic/queue.js +11 -14
  9. package/coms/basic/rest_.js +27 -0
  10. package/coms/kugou/parseSongsList.js +1 -1
  11. package/coms/kugou/player.js +3 -2
  12. package/coms/zimoli/Promise.js +84 -133
  13. package/coms/zimoli/appendChild.js +4 -14
  14. package/coms/zimoli/cless.js +11 -5
  15. package/coms/zimoli/color.js +0 -1
  16. package/coms/zimoli/compile.js +64 -1
  17. package/coms/{compile → zimoli}/compile_test.js +0 -0
  18. package/coms/zimoli/cross.js +1 -1
  19. package/coms/zimoli/data.js +6 -2
  20. package/coms/zimoli/dispatch.js +1 -1
  21. package/coms/zimoli/on.js +64 -47
  22. package/coms/zimoli/remove.js +0 -9
  23. package/coms/zimoli/render.js +2 -2
  24. package/coms/zimoli/zimoli.js +2 -2
  25. package/package.json +1 -1
  26. package/public/efront.js +1 -1
  27. package/coms/compile/breakcode.js +0 -78
  28. package/coms/compile/common.js +0 -683
  29. package/coms/compile/compile.js +0 -64
  30. package/coms/compile/keywords.js +0 -6
  31. package/coms/compile/namelist.js +0 -142
  32. package/coms/compile/namelist_test.js +0 -7
  33. package/coms/compile/required.js +0 -20
  34. package/coms/compile/scanner.js +0 -653
  35. package/coms/compile/scanner2.js +0 -909
  36. package/coms/compile/scanner2_test.js +0 -85
  37. package/coms/compile/scanner_test.js +0 -10
  38. package/coms/compile/washcode.js +0 -313
  39. package/coms/zimoli/mark.js +0 -70
@@ -4,177 +4,128 @@ var setTimeout = window.setTimeout;
4
4
  var Function = window.Function;
5
5
  var console = window.console;
6
6
  var Error = window.Error;
7
+ var requestAnimationFrame = window.setImmediate || window.setTimeout;
7
8
  var isFunction = function (f) {
8
9
  return typeof f === "function";
9
10
  };
10
11
  if (window.Promise) {
11
12
  var Promise = window.Promise;
12
13
  } else {
13
- var isPromise = function (pendding) {
14
- return pendding instanceof Promise || pendding && isFunction(pendding.then) && isFunction(pendding.catch);
14
+ var isThenable = function (pendding) {
15
+ return pendding instanceof Promise || pendding && isFunction(pendding.then);
15
16
  };
16
-
17
- var concat = function (okfun, ohfun, oks, ohs) {
18
- var _oked, _ohed, _ok, _oh, removeed;
19
- var runable = function (ok, oh) {
20
- if (_oked) {
21
- ok.apply(null, _oked);
22
- } else if (_ohed) {
23
- oh.apply(null, _ohed);
24
- } else {
25
- _ok = ok;
26
- _oh = oh;
27
- }
28
- };
29
- var _promise = new Promise(runable);
30
- var onpermit = function (f, args) {
31
- if (!removeed) {
32
- try {
33
- var pendding = f.apply(null, args);
34
- if (_ok) _ok(pendding);
35
- else _oked = [pendding];
36
- } catch (e) {
37
- if (_oh) _oh(e);
38
- else _ohed = [e];
17
+ var queue = [];
18
+ var run = function (q) {
19
+ var threads = queue.splice(0, queue.length);
20
+ for (var t of threads) {
21
+ if (t.oked) {
22
+ for (var r of t.PromiseFulfillReactions) {
23
+ r.apply(null, t.oked);
39
24
  }
40
- removeed = true;
41
- }
42
- };
43
- var onresolve = function () {
44
- if (okfun instanceof Function) onpermit(okfun, arguments);
45
- if (!removeed) {
46
- if (_ok) _ok.apply(null, arguments);
47
- else _oked = arguments;
48
- removeed = true;
49
25
  }
50
- };
51
- var onreject = function () {
52
- if (ohfun instanceof Function) onpermit(ohfun, arguments);
53
- if (!removeed) {
54
- if (_oh) _oh.apply(null, arguments);
55
- else _ohed = arguments;
56
- removeed = true;
26
+ if (t.ohed) {
27
+ if (!t.PromiseRejectReactions.length) throw `未处理的异常:${t.ohed}`;
28
+ for (var r of t.PromiseRejectReactions) {
29
+ r.apply(null, t.ohed);
30
+ }
57
31
  }
58
- };
59
- oks.push(onresolve);
60
- ohs.push(onreject);
61
- return _promise;
62
- }
63
-
32
+ t.PromiseRejectReactions.splice(0, t.PromiseRejectReactions.length);
33
+ t.PromiseFulfillReactions.splice(0, t.PromiseFulfillReactions.length);
34
+ }
35
+ };
36
+ var fire = function (p) {
37
+ if (queue.length) return queue.push(p);
38
+ queue.push(p);
39
+ requestAnimationFrame(run);
40
+ };
64
41
  var Promise = function (executor) {
65
- var PromiseFulfillReactions = this.PromiseFulfillReactions = [], //thens
66
- PromiseRejectReactions = this.PromiseRejectReactions = [], //catches
67
- oked = this.oked, ohed = this.ohed;
42
+ this.PromiseFulfillReactions = []; //thens
43
+ this.PromiseRejectReactions = []; //catches
44
+ this.oked = this.ohed = null;
68
45
 
69
46
  var ResolvingFunctions_resolve = (result) => { //ok
70
- if (isPromise(result)) {
71
- result.then(ResolvingFunctions_resolve).catch(ResolvingFunctions_reject);
47
+ if (this.oked || this.ohed) return;
48
+ if (isThenable(result)) {
49
+ result.then(ResolvingFunctions_resolve, ResolvingFunctions_reject);
72
50
  } else {
73
- oked = this.oked = arguments;
74
- this.run(PromiseFulfillReactions, oked);
51
+ this.oked = arguments;
52
+ fire(this);
75
53
  }
76
54
  };
77
55
 
78
56
  var ResolvingFunctions_reject = (e) => { //oh
79
- ohed = this.ohed = arguments;
80
- this.run(PromiseRejectReactions, ohed);
57
+ if (this.oked || this.ohed) return;
58
+ this.ohed = arguments;
59
+ fire(this);
81
60
  };
82
-
83
- try {
84
- executor(ResolvingFunctions_resolve, ResolvingFunctions_reject);
85
- } catch (e) {
86
- ResolvingFunctions_reject(e);
87
- }
61
+ executor(ResolvingFunctions_resolve, ResolvingFunctions_reject);
88
62
  };
89
63
  Promise.prototype = {
90
64
  then(onok, onoh) {
91
- var _promise = concat(onok, onoh, this.PromiseFulfillReactions, this.PromiseRejectReactions);
92
- this.oked && this.run(this.PromiseFulfillReactions, this.oked);
93
- this.ohed && this.run(this.PromiseRejectReactions, this.ohed);
94
- return _promise;
65
+ var resolve, reject;
66
+ var promise = new Promise(function (ok, oh) {
67
+ if (onok) resolve = function (a) {
68
+ try {
69
+ a = onok(a);
70
+ ok(a);
71
+ } catch (e) {
72
+ oh(e);
73
+ }
74
+ };
75
+ if (onoh) reject = function (a) {
76
+ try {
77
+ a = onoh(a);
78
+ ok(a);
79
+ } catch (e) {
80
+ oh(e);
81
+ }
82
+ };
83
+ })
84
+ if (resolve) this.PromiseFulfillReactions.push(resolve);
85
+ if (reject) this.PromiseRejectReactions.push(reject);
86
+ if (this.oked || this.ohed) fire(this);
87
+ return promise;
95
88
  },
96
89
  catch(f) {
97
90
  return this.then(null, f);
98
91
  },
99
- run(threads, args) {
100
- if (threads.pendding) return;
101
- threads.pendding = true;
102
- setTimeout(_ => {
103
- do {
104
- var next = threads.shift();
105
- if (next instanceof Function) {
106
- next.apply(null, args);
107
- }
108
- } while (threads.length);
109
- this.PromiseRejectReactions.splice(0, this.PromiseRejectReactions.length);
110
- this.PromiseFulfillReactions.splice(0, this.PromiseFulfillReactions.length);
111
- threads.pendding = false;
112
- }, 0);
113
- }
114
92
  }
115
93
  Promise.all = function (penddings) {
116
94
  return new Promise(function (ok, oh) {
117
95
  if (!(penddings && penddings.length)) {
118
96
  return ok();
119
97
  }
120
- try {
121
- var resolved_count = 0,
122
- rejected_count = 0,
123
- results = Array(penddings.length);
124
- for (var cx = 0, dx = penddings.length; cx < dx; cx++) {
125
- var pendding = penddings[cx];
126
- if (isPromise(pendding)) {
127
- pendding.then(function (cx) {
128
- return function (arg) {
129
- results[cx] = arg;
130
- if (++resolved_count === dx) {
131
- ok(results);
132
- }
133
- };
134
- }(cx));
135
- pendding.catch(function (e) {
136
- if (rejected_count++ === 0) {
137
- oh(e);
98
+ var resolved_count = 0,
99
+ results = Array(penddings.length);
100
+ for (var cx = 0, dx = penddings.length; cx < dx; cx++) {
101
+ var pendding = penddings[cx];
102
+ if (isThenable(pendding)) {
103
+ pendding.then(function (cx) {
104
+ return function (arg) {
105
+ results[cx] = arg;
106
+ if (++resolved_count === dx) {
107
+ ok(results);
138
108
  }
139
- });
140
- } else {
141
- results[cx] = pendding;
142
- if (++resolved_count === dx) {
143
- ok(results);
144
- }
145
- };
146
- }
147
- } catch (e) {
148
- oh(e);
109
+ };
110
+ }(cx), oh);
111
+ } else {
112
+ results[cx] = pendding;
113
+ if (++resolved_count === dx) {
114
+ ok(results);
115
+ }
116
+ };
149
117
  }
150
118
  });
151
119
  };
152
120
  Promise.race = function (penddings) {
153
121
  return new Promise(function (ok, oh) {
154
- try {
155
- var resolved_count = 0,
156
- rejected_count = 0,
157
- results = Array(penddings.length);
158
- for (var cx = 0, dx = penddings.length; cx < dx; cx++) {
159
- var pendding = penddings[cx];
160
- if (isPromise(pendding)) {
161
- pendding.then(function (cx) {
162
- return function (arg) {
163
- if (++resolved_count === 0) {
164
- ok(arg);
165
- }
166
- };
167
- }(cx)).catch(function (e) {
168
- if (rejected_count++ === dx) {
169
- oh(e);
170
- }
171
- });
172
- } else {
173
- results[cx] = pendding;
174
- };
175
- }
176
- } catch (e) {
177
- oh(e);
122
+ for (var cx = 0, dx = penddings.length; cx < dx; cx++) {
123
+ var pendding = penddings[cx];
124
+ if (isThenable(pendding)) {
125
+ pendding.then(ok, oh);
126
+ } else {
127
+ ok(pendding);
128
+ };
178
129
  }
179
130
  });
180
131
  };
@@ -15,18 +15,9 @@ function _onappend(node, append = createEvent("append"), mount = createEvent("mo
15
15
  if (node.isMounted) return;
16
16
  if (node.nodeType === 1 || node.nodeType === 8) node.isMounted = true;
17
17
  dispatch(node, append);
18
- var onappend = node.onappend;
19
- if (isArray(onappend)) {
20
- onappend.map(function (append_handler) {
21
- append_handler.call(this, append);
22
- }, node);
23
- }
24
- if (isFunction(onappend)) {
25
- onappend.call(node, append);
26
- }
27
- var children = [].concat.apply([], node.childNodes);
28
- if (children) for (var cx = 0, dx = children.length; cx < dx; cx++) {
29
- _onappend(children[cx], append, mount);
18
+ var children = [...node.childNodes];
19
+ for (var c of children) {
20
+ _onappend(c, append, mount);
30
21
  }
31
22
  dispatch(node, mount);
32
23
  }
@@ -93,8 +84,7 @@ function insertAfter(alreadyMounted, obj, transition) {
93
84
  if (o.removeTimer) clearTimeout(o.removeTimer);
94
85
  _insertBefore.call(parent, o, alreadyMounted.nextSibling);
95
86
  o.with && insertBefore(alreadyMounted.nextSibling, o.with, transition);
96
- if (isMounted(parent))
97
- _onappend(o);
87
+ if (isMounted(parent)) _onappend(o);
98
88
  if (hasEnterStyle(o) && transition !== false) {
99
89
  isFunction(appendChild.transition) && appendChild.transition(o);
100
90
  }
@@ -1,25 +1,31 @@
1
1
 
2
- function create(commFactory, className) {
2
+ var _create = function (commFactory, className, _invoke) {
3
3
  if (!className) return commFactory;
4
4
  if (commFactory instanceof Promise) {
5
5
  return commFactory.then(function (result) {
6
- return create(result, className);
6
+ return _invoke(result, className, _invoke);
7
7
  });
8
8
  }
9
9
  if (isFunction(commFactory)) {
10
10
  var result = function () {
11
11
  var commRelease = commFactory.apply(this || result, arguments);
12
12
  if (commRelease) {
13
- commRelease = create(commRelease, className);
13
+ commRelease = _invoke(commRelease, className, _invoke);
14
14
  }
15
15
  return commRelease;
16
16
  };
17
17
  result.prototype = commFactory.prototype;
18
18
  commFactory.className = className;
19
19
  keys(commFactory).map(k => result[k] = commFactory[k]);
20
+ result.call = function (context, ...args) {
21
+ if (!isEmpty(context)) var release = commFactory.apply(context, args);
22
+ else release = commFactory.apply(result, args);
23
+ if (release) release = _invoke(release, className, _invoke);
24
+ return release;
25
+ };
20
26
  if ({}.hasOwnProperty.call(commFactory, 'toString')) {
21
27
  result.toString = function () {
22
- return create(commFactory.toString(), className);
28
+ return _invoke(commFactory.toString(), className, _invoke);
23
29
  };
24
30
  }
25
31
  return result;
@@ -54,5 +60,5 @@ function cless(commFactory, innerCss, className) {
54
60
  }
55
61
  appendChild(head, stylesheet);
56
62
  }
57
- return create(commFactory, className);
63
+ return _create(commFactory, className, _create);
58
64
  }
@@ -381,7 +381,6 @@ extend(color, {
381
381
  },
382
382
  rgb2h,
383
383
  rgb4h,
384
- rgb4s,
385
384
  rgb2v,
386
385
  rgb4v,
387
386
  rgb2s,
@@ -1 +1,64 @@
1
- "use ../compile/compile.js"
1
+ "use strict";
2
+ var Scanner = function (dataString, syntax) {
3
+ this.source = dataString;
4
+ this.syntax = syntax.syntax;
5
+ this.entry = syntax.entry;
6
+ var Token = this.token = syntax.token;
7
+ var block = this.block = new Token(syntax.entry, 0);
8
+ block.scanner = this;
9
+ this.blocks = this.block.children = [];
10
+ this.source = dataString;
11
+ }
12
+ Scanner.prototype = {
13
+ scan(index = 0, type = this.entry, collection = this.blocks, parent = this.block) {
14
+ var regInfo = this.syntax[type];
15
+ var dataString = this.source;
16
+ var Block = this.token;
17
+ if (!regInfo) return index;
18
+ if (!(regInfo instanceof Array)) {
19
+ regInfo = [regInfo];
20
+ }
21
+ var reg = regInfo[0];
22
+ loop: while (index < dataString.length) {
23
+ reg.lastIndex = index;
24
+ var res = reg.exec(dataString, collection);
25
+ if (res) {
26
+ index = reg.lastIndex;
27
+ var inc = 0;
28
+ while (res[++inc] === undefined) {
29
+ if (inc >= regInfo.length) break loop;
30
+ }
31
+ var matchType = regInfo[inc];
32
+ if (!matchType) continue;
33
+ var savedIndex = reg.lastIndex - res[inc].length;
34
+ var children = [];
35
+ var block = new Block(matchType, savedIndex);
36
+ block.parent = parent;
37
+ block.children = children;
38
+ block.root = this.block;
39
+ block.scanner = this;
40
+ index = this.scan(index, matchType, children, block);
41
+ if (collection && savedIndex < index) {
42
+ if (collection.length) {
43
+ var lastChild = collection[collection.length - 1];
44
+ block.prev = lastChild;
45
+ lastChild.next = block;
46
+ }
47
+ collection.push(block);
48
+ }
49
+ block.end = index;
50
+ } else if (/y/.test(reg.flags)) {
51
+ throw new Error(`unexcepted token ${dataString[index]}`);
52
+ } else {
53
+ index = dataString.length;
54
+ }
55
+ }
56
+ return index;
57
+ }
58
+ }
59
+ var scan = function (data, syntax) {
60
+ var scanner = new Scanner(data, syntax);
61
+ scanner.scan();
62
+ return scanner.blocks;
63
+ };
64
+ module.exports = scan;
File without changes
@@ -20,7 +20,7 @@ if (cookiesData) {
20
20
  var digest = function () {
21
21
  dispatch('render', window);
22
22
  };
23
-
23
+ if (/Trident/i.test(navigator.userAgent)) digest = lazy(digest, 60);
24
24
  var cross = cross_.bind(function (callback, onerror) {
25
25
  var xhr = new XMLHttpRequest;
26
26
  var abort = xhr.abort;
@@ -323,9 +323,13 @@ var parseData = function (sourceText) {
323
323
  sourceText = sourceText
324
324
  .replace(/<!--[\s\S]*?-->|<\[CDATA\[[\s\S]*?\]\]>/ig, '')
325
325
  .replace(/^[\s\S]*?<html>([\s\S]*)<\/html>[\s\S]*?$/i, '$1')
326
- .replace(/^[\s\S]*?<body>([\s\S]*?)$/i, '$1')
326
+ .replace(/^([\s\S]*?)<body>([\s\S]*?)$/i, '$1<body>$2')
327
327
  .replace(/<\/body>[\s\S]*?$/, '');
328
- doc.body.innerHTML = sourceText;
328
+ var div = document.createElement('div');
329
+ div.innerHTML = sourceText.replace(/^([\s\S]*?)<body>[\s\S]*?$/, "$1")
330
+ .replace(/<head>/i, '').replace(/<\/head>/i, '');
331
+ for (var c of [...div.childNodes]) doc.head.appendChild(c);
332
+ doc.body.innerHTML = sourceText.replace(/^[\s\S]*?<body>/, '');
329
333
  } else {
330
334
  doc.documentElement.innerHTML = sourceText;
331
335
  }
@@ -1,6 +1,6 @@
1
1
  var dispatch = "dispatchEvent" in document ? function dispatchEvent(target, event) {
2
2
  return target.dispatchEvent(event);
3
- } : function fireEvent(target, event) {
3
+ } : function (target, event) {
4
4
  var fire = "on" + event.type;
5
5
  try {
6
6
  return target.fireEvent(fire, event);
package/coms/zimoli/on.js CHANGED
@@ -1,6 +1,19 @@
1
- "use strict";
1
+ // "use strict";
2
2
  if (document.efronton) return document.efronton;
3
3
  var is_addEventListener_enabled = "addEventListener" in window;
4
+ if ('attachEvent' in document) {
5
+ is_addEventListener_enabled = false;
6
+ }
7
+ if (!is_addEventListener_enabled) var __call = function (target, context, handler, firstmost) {
8
+ // use strict 无效的情况
9
+ if (isEmpty(target)) {
10
+ this(context, context, handler, firstmost);
11
+ }
12
+ else {
13
+ this(target, context, handler, firstmost);
14
+ }
15
+ };
16
+
4
17
  var handlersMap = {};
5
18
  var changes_key = 'changes';
6
19
  var eventtypereg = /(?:\.once|\.prevent|\.stop|\.capture|\.self|\.passive|\.[a-z0-9]+)+\.?$/i;
@@ -70,7 +83,6 @@ var keyCodeMap = {
70
83
  numdot: 110,
71
84
  divide: 111,
72
85
  div: 111,
73
- "/": 111,
74
86
  f1: 112,
75
87
  f2: 113,
76
88
  f3: 114,
@@ -104,7 +116,7 @@ var keyCodeMap = {
104
116
  ">": 110,
105
117
  slash: 191,
106
118
  "/": 191,
107
- ">": 191,
119
+ "?": 191,
108
120
  backquote: 192,
109
121
  "`": 192,
110
122
  "~": 192,
@@ -308,50 +320,55 @@ var on = document.efronton = function (k) {
308
320
  return remove.bind(target, k, hk, listener);
309
321
  };
310
322
 
311
- else var addhandler = function (context, handler, firstmost = false) {
312
- var target = this || context;
313
- if (eventtypes.capture) {
314
- console.warn("当前运行环境不支持事件capture");
315
- firstmost = true;
316
- }
317
- target = checkroot(target, k);
318
- if (target[handler_path] instanceof Array) {
319
- } else {
320
- var h = function (e) {
321
- if (!e) e = window.event || {};
322
- if (!e.target && e.srcElement) {
323
- e.target = e.srcElement;
324
- }
325
- if (e.stopedPropagation) return;
326
- if (!e.stopPropagation) {
327
- e.stopPropagation = function () {
328
- this.stopedPropagation = true;
329
- };
330
- }
331
- if (!e.preventDefault) {
332
- e.preventDefault = function () {
333
- e.returnValue = false;
334
- e.defaultPrevented = true;
335
- };
336
- }
337
- if (e.button) {
338
- if (e.buttons === undefined) e.buttons = e.button;
339
- if (e.which === undefined) e.which = e.button + 1;
340
- }
341
- if (e.keyCode) {
342
- if (e.which === undefined) e.which = e.keyCode;
343
- }
344
- broadcast.call(target, k, handler_path, e);
345
- return e.returnValue;
346
- };
347
- target[handler_path] = target["on" + k] && target["on" + k] !== handler ? [[{}, target["on" + k]]] : [];
348
- target[handler_path].h = h;
349
- target["on" + k] = h;
350
- }
351
- var listener = [eventtypes, handler, context];
352
- append.call(target, k, handler_path, listener, firstmost);
353
- return remove.bind(target, k, handler_path, listener);
354
- };
323
+ else {
324
+ var _addhandler = function (target, context, handler, firstmost = false) {
325
+ if (eventtypes.capture) {
326
+ console.warn("当前运行环境不支持事件capture");
327
+ firstmost = true;
328
+ }
329
+ target = checkroot(target, k);
330
+ if (target[handler_path] instanceof Array) {
331
+ } else {
332
+ var h = function (e) {
333
+ if (!e) e = window.event || {};
334
+ if (!e.target && e.srcElement) {
335
+ e.target = e.srcElement;
336
+ }
337
+ if (e.stopedPropagation) return;
338
+ if (!e.stopPropagation) {
339
+ e.stopPropagation = function () {
340
+ this.stopedPropagation = true;
341
+ };
342
+ }
343
+ if (!e.preventDefault) {
344
+ e.preventDefault = function () {
345
+ e.returnValue = false;
346
+ e.defaultPrevented = true;
347
+ };
348
+ }
349
+ if (e.button) {
350
+ if (e.buttons === undefined) e.buttons = e.button;
351
+ if (e.which === undefined) e.which = e.button + 1;
352
+ }
353
+ if (e.keyCode) {
354
+ if (e.which === undefined) e.which = e.keyCode;
355
+ }
356
+ broadcast.call(target, k, handler_path, e);
357
+ return e.returnValue;
358
+ };
359
+ target[handler_path] = target["on" + k] && target["on" + k] !== handler ? [[{}, target["on" + k]]] : [];
360
+ target[handler_path].h = h;
361
+ target["on" + k] = h;
362
+
363
+ }
364
+ var listener = [eventtypes, handler, context];
365
+ append.call(target, k, handler_path, listener, firstmost);
366
+ return remove.bind(target, k, handler_path, listener);
367
+ }, addhandler = function (context, handler, firstmost) {
368
+ return _addhandler(context, context, handler, firstmost);
369
+ };
370
+ addhandler.call = __call.bind(_addhandler);
371
+ }
355
372
  handlersMap[on_event_path] = addhandler;
356
373
  return addhandler;
357
374
  };
@@ -43,19 +43,10 @@ function _onremove(node, event) {
43
43
  if (!node || node.isMounted === false) return;
44
44
  var children = node.childNodes;
45
45
  if (node.isMounted) {
46
- var onremove = node.onremove;
47
46
  if (!event) {
48
47
  event = createEvent("remove");
49
48
  }
50
49
  dispatch(node, event);
51
- if (isArray(onremove)) {
52
- onremove.map(function (remove_hindler) {
53
- remove_hindler.call(this, event);
54
- }, node);
55
- }
56
- if (isFunction(onremove)) {
57
- onremove.call(node, event);
58
- }
59
50
  node.isMounted = false;
60
51
  }
61
52
  if (children) for (var cx = 0, dx = children.length; cx < dx; cx++) {
@@ -173,7 +173,7 @@ var createRepeat = function (search, id = 0) {
173
173
  var $parentScopes = element.$parentScopes || [];
174
174
  var $struct = element.$struct;
175
175
  if (element.$scope) {
176
- $struct = Object.assign({}, $struct, { context: $struct.context + `with(this.$parentScopes[${$parentScopes.length}])` }), $parentScopes = $parentScopes.concat(element.$scope);
176
+ $struct = extend({}, $struct, { context: $struct.context + `with(this.$parentScopes[${$parentScopes.length}])` }), $parentScopes = $parentScopes.concat(element.$scope);
177
177
  }
178
178
  var clonedElements1 = Object.create(null);
179
179
  var cloned = keys.map(function (key, cx) {
@@ -631,7 +631,7 @@ function getFromScopes(key, scope, parentScopes) {
631
631
 
632
632
  function renderElement(element, scope = element.$scope, parentScopes = element.$parentScopes, once) {
633
633
  if (!isNode(element) && element.length) {
634
- return Array.prototype.slice.call(element, 0, element.length).map(function (element) {
634
+ return Array.prototype.concat.apply([], element).map(function (element) {
635
635
  return renderElement(element, scope, parentScopes, once);
636
636
  });
637
637
  }
@@ -301,7 +301,7 @@ function prepare(pgpath, ok) {
301
301
  if (isString(menu)) {
302
302
  res = state.go(menu, item);
303
303
  } else if (menu && menu.path) {
304
- menu = Object.assign({}, menu, { path: state.path(menu.path) });
304
+ menu = extend({}, menu, { path: state.path(menu.path) });
305
305
  res = go(menu, undefined, undefined, pgpath);
306
306
  } else {
307
307
  res = action(menu, item, params);
@@ -476,7 +476,7 @@ var pushstate = function (path_name, history_name, oldpagepath) {
476
476
  history[history_name] = [path_name];
477
477
  } else {
478
478
  var _history = history[history_name];
479
- if (_history.indexOf(oldpagepath) < 0) {
479
+ if ([].indexOf.call(_history, oldpagepath, 0) < 0) {
480
480
  _history.splice(root_path === _history[0], _history.length);
481
481
  isDestroy = true;
482
482
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efront",
3
- "version": "3.22.10",
3
+ "version": "3.24.3",
4
4
  "description": "一个开发工具,开放源代码,自带组件库和编译环境,可以用来开发web组件,web应用或nodejs模块,或做为已有代码的加密工具,也可以做为静态页面服务器或跨域中转服务器使用",
5
5
  "main": "public/efront.js",
6
6
  "directories": {