efront 4.6.3 → 4.7.1

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.
@@ -1,3 +1,12 @@
1
+ - zh-CN: 检查完毕!
2
+ en: Check completed!
3
+
4
+ - zh-CN: 在$1个文件中找到$2处易错代码!
5
+ en: Found $2 error prone codes in $1 files!
6
+
7
+ - zh-CN: 后续代码
8
+ en: Subsequent code
9
+
1
10
  - zh-CN: 文件$1中暂未发现已记录的问题
2
11
  en: No recorded issues have been found in file $1 yet
3
12
 
@@ -78,6 +78,9 @@ class Table extends Array {
78
78
  if (s.length === 1) return s[0];
79
79
  return i18n`共${this.$summary[i].length}个不同的项`;
80
80
  },
81
+ set(v) {
82
+ this.$summary[i] = [v];
83
+ }
81
84
  })
82
85
  return [];
83
86
  });
@@ -453,6 +453,9 @@ function createApiMap(data) {
453
453
  if (headers && !reg.test(headers)) {
454
454
  _headers = parseKV(headers);
455
455
  }
456
+ else {
457
+ _headers = undefined;
458
+ }
456
459
  if (!base) continue;
457
460
  href = /(https?\:)?|\.?\//i.test(base) ? base : '';
458
461
  var item1 = items1[key];
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  var languageMap = {};
3
3
  var languageIndex = 0;
4
- function i18n(arg) {
4
+ function i18n() {
5
+ var [arg] = arguments;
5
6
  if (typeof arg === 'string' || !isArrayLike(arg)) arg = arguments;
6
7
  return arg[isFinite(this) ? this : languageIndex];
7
8
  };
@@ -1,4 +1,5 @@
1
- function refilm(str) {
1
+ function refilm() {
2
+ var [str] = arguments;
2
3
  if (str.raw) str = str.raw;
3
4
  return refilm_decode.apply(null, [str].concat([].slice.call(arguments, 1)));
4
5
  }
@@ -114,7 +114,8 @@ var compare = function (a, b) {
114
114
  if (delta) return delta;
115
115
  return 0;
116
116
  }
117
- function sortname(list = this) {
117
+ function sortname() {
118
+ var [list = this] = arguments;
118
119
  if (this !== arguments[1] && arguments.length === 2) {
119
120
  return compare(arguments[0], arguments[1]);
120
121
  }
@@ -21,7 +21,6 @@ var exec_ = function (args, ok, oh, int) {
21
21
  next(err);
22
22
  }
23
23
  else {
24
- catches.pop();
25
24
  fina();
26
25
  }
27
26
  }
@@ -32,7 +31,7 @@ var exec_ = function (args, ok, oh, int) {
32
31
  var retn = function (p) {
33
32
  r = p;
34
33
  finished = true;
35
- if (catches.length) fina();
34
+ if (catch_ || catches.length) fina();
36
35
  else ok(r);
37
36
  };
38
37
  var fina = function () {
@@ -44,7 +43,6 @@ var exec_ = function (args, ok, oh, int) {
44
43
  next();
45
44
  };
46
45
  var fine = function () {
47
- catches.pop();
48
46
  if (throwed) thro(e);
49
47
  else if (finished) retn(r);
50
48
  else {
@@ -57,11 +55,9 @@ var exec_ = function (args, ok, oh, int) {
57
55
  while (index < args_length) {
58
56
  try {
59
57
  var a = args[index](p) || [1, 0];
60
- catch_ = null;
61
58
  p = a[0];
62
59
  i = a[1];
63
60
  } catch (e) {
64
- p = null;
65
61
  thro(e);
66
62
  return;
67
63
  }
@@ -73,17 +69,19 @@ var exec_ = function (args, ok, oh, int) {
73
69
  try {
74
70
  return p.then(next, thro);
75
71
  } catch (e) {
76
- return Promise.reject(e).then(next, thro);
72
+ return Promise.reject(e).then(null, thro);
77
73
  }
78
74
  }
79
75
  else return next(p);
80
76
  case 2: return finished = true, retn(p); // return p;
81
77
  case 3: return index++, int(p, next); // yield p;
78
+ case 4: return thro(p); // throw p; 目前无此返回值
82
79
  case 7: index++; catches.push([index, p]); break; // try catch finally?
83
80
  case 8: index++; catches.push([index, p, 1]); break; // try finally
84
81
  case 9: return p ? fine() : fina(); // finally
85
82
  default: throw console.log(a), i18n`代码异常!`;
86
83
  }
84
+ catch_ = null;
87
85
  }
88
86
  retn();
89
87
  };
@@ -27,22 +27,41 @@ var c = async function () {
27
27
 
28
28
  await b();
29
29
  } catch (e) {
30
- console.log(e)
30
+ console.log(e, 'catched')
31
31
  return 9;
32
32
  }
33
33
  finally {
34
- console.log(8)
34
+ console.log(8, 'finally')
35
35
  }
36
36
  };
37
37
  var d = async function () {
38
38
  try {
39
- throw new Error(10);
39
+ throw new Error("不该出现此错误");
40
40
  }
41
41
  catch (e) {
42
+ console.log(10, 'catched');
42
43
  throw e;
43
44
  }
45
+ finally {
46
+ console.log(11);
47
+ return 12;
48
+ }
49
+ }
50
+ var e = async function () {
51
+ try {
52
+ throw new Error("不该出现此错误");
53
+ }
54
+ catch (e) {
55
+ console.log(13, 'catched');
56
+ throw e;
57
+ }
58
+ finally {
59
+ console.log(14);
60
+ throw new Error("这是最后的报错");
61
+ }
44
62
  }
45
63
  console.log(0, process.uptime())
46
64
  await a();
47
65
  console.log(await c());
48
- await d();
66
+ console.log(await d());
67
+ await e();
@@ -381,6 +381,7 @@ Javascript.prototype.setType = function (o) {
381
381
  if (last && last.type === PROPERTY && propresolve_reg.test(last.text)) {
382
382
  last.type = STRAP;
383
383
  }
384
+ if (queue.isClass) o.isend = false;
384
385
  }
385
386
  }
386
387
  if (o.type === PROPERTY || o.isprop);
@@ -519,6 +520,15 @@ function detour(o, ie) {
519
520
  if (hasdot) text = "..." + text;
520
521
  o.text = text;
521
522
  break;
523
+ case VALUE:
524
+ o.text = String(o.text).replace(/_/g, '')
525
+ .replace(/\.e/, 'e')
526
+ .replace(/\.$/, '')
527
+ .replace(/^\./, '0.');
528
+ if (/^0[0-7]+$/.test(o.text)) {
529
+ o.text = '0o' + o.text.slice(1);
530
+ }
531
+ break;
522
532
  case QUOTED:
523
533
  if (o.length) {
524
534
  if (!o.prev || o.prev.type & (STAMP | STRAP)) {
@@ -586,7 +596,7 @@ function detour(o, ie) {
586
596
  }
587
597
  if (!o.isprop) break;
588
598
  case PROPERTY:
589
- if (/^(get|set|async|static)$/.test(o.text) && o.next && (o.next.type === PROPERTY || o.next.isprop)) break;
599
+ if (!o.isend && /^(get|set|async|static)$/.test(o.text) && o.next && (o.next.type === PROPERTY || o.next.isprop)) break;
590
600
  if (o.text === 'static' && o.next && o.next.type === SCOPED && o.next.entry === '{') break;
591
601
  if (/^\[/.test(o.text)) break;
592
602
  if (o.queue.isObject) {
@@ -609,7 +619,7 @@ function detour(o, ie) {
609
619
  var text = strings.recode(o.text);
610
620
  if (o.prev) {
611
621
  var prev = o.prev;
612
- if (prev && prev.isprop && /^(get|set|static|async)$/.test(prev.text)) {
622
+ if (prev && prev.isprop && !prev.isend && /^(get|set|static|async)$/.test(prev.text)) {
613
623
  prev = prev.prev;
614
624
  }
615
625
  if (prev && prev.type === STAMP && prev.isprop) prev = prev.prev;
@@ -14,4 +14,31 @@ testFix(`import("a")`, 'require("a")');
14
14
  testFix(`import "windows.inc"`, 'require("windows.inc")');
15
15
  testFix(`import "windows.inc";import "abc.inc";`, 'require("windows.inc"); require("abc.inc");');
16
16
  testFix(`import "windows.inc";\r\nimport "abc.inc";`, 'require("windows.inc");\r\nrequire("abc.inc");');
17
- testFix(`console.log(import.meta)`, `console.log(import_meta)`);
17
+ testFix(`console.log(import.meta)`, `console.log(import_meta)`);
18
+ var testDetour = function (a, e) {
19
+ var c = scanner2(a);
20
+ c.break();
21
+ assert(c.toString(), e);
22
+ }
23
+ testDetour('1.1', '1.1')
24
+ testDetour('1.1.a', '1.1["a"]')
25
+ testDetour('-1e10.a', '-1e10["a"]')
26
+ testDetour('1e10.a', '1e10["a"]')
27
+ testDetour('1e1_0.a', '1e10["a"]')
28
+ testDetour('1_20e1_0.a', '120e10["a"]')
29
+ testDetour('1_2.0_3e1_0.a', '12.03e10["a"]')
30
+ testDetour('1.e10.a', '1e10["a"]')
31
+ testDetour('1.e-10.a', '1e-10["a"]')
32
+ testDetour('1.e+10.a', '1e+10["a"]')
33
+ testDetour('0x1.a', '0x1["a"]')
34
+ testDetour('0b1.a', '0b1["a"]')
35
+ testDetour('01.a', '0o1["a"]')
36
+ testDetour('08.a', '08 a')
37
+ testDetour('0o1.a', '0o1["a"]')
38
+ testDetour('0o1n.a', '0o1n["a"]')
39
+ testDetour('0o1m.a', '0o1m["a"]')
40
+ testDetour('0o1i.a', '0o1i["a"]')
41
+ testDetour('0o1j.a', '0o1j["a"]')
42
+ testDetour('0o1k.a', '0o1k["a"]')
43
+ testDetour('0o1l.a', '0o1l["a"]')
44
+ testDetour('0o1ll.a', '0o1ll["a"]')
@@ -144,6 +144,7 @@ class Program {
144
144
  exec(text) {
145
145
  if (!this.entry_reg) this.commit();
146
146
  var index = this.lastIndex;
147
+ this.lastIndex = text.length;
147
148
  var parents = [];
148
149
  var lasttype;
149
150
  var Code = this.Code;
@@ -423,7 +424,7 @@ class Program {
423
424
  var match = reg.exec(text);
424
425
  if (!match) return null;
425
426
  var end = match[0].length + match.index;
426
- this.lastIndex = index = end;
427
+ index = end;
427
428
  var m = match[0];
428
429
  test: if (this.quote_map.hasOwnProperty(m)) {
429
430
  var last = queue.last;
@@ -467,7 +468,7 @@ class Program {
467
468
  break;
468
469
  }
469
470
  var m = match[0];
470
- index = this.lastIndex = match.index + m.length;
471
+ index = match.index + m.length;
471
472
  if (quote.length === 2) {
472
473
  break;
473
474
  }
@@ -532,7 +533,12 @@ class Program {
532
533
  save(STRAP);
533
534
  continue;
534
535
  }
535
- var isdigit = this.number_reg.test(m);
536
+ var isdigit = number_reg.exec(m);
537
+ if (isdigit) {
538
+ m = isdigit[0];
539
+ index = match.index + m.length;
540
+ isdigit = true;
541
+ }
536
542
  if (this.value_reg.test(m) || isdigit) {
537
543
  queue.inExpress = true;
538
544
  if (isdigit && lasttype === STAMP) {
@@ -633,6 +639,7 @@ class Program {
633
639
  queue_push(p);
634
640
  }
635
641
  };
642
+ this.lastIndex = index;
636
643
  if (queue !== origin) {
637
644
  throw console.log(createString(origin), `\r\n------ deep: ${parents.length}\r\n --- enrty: ${queue.entry}\r\n -- length: ${queue.length}\r\n ---- last: ${createString([queue.last])}\r\n------- end\r\n --parents: ${parents.map(p => p.tag || p.entry || p.text).join('->')}`, createString([queue]).slice(-200)), "代码异常结束";
638
645
  }
@@ -713,7 +720,7 @@ class Program {
713
720
  this.space_reg = new RegExp(`^[${spaces}]+$`, flagUnicode);
714
721
  this.space_exp = new RegExp(`[${spaces}]+`, flagUnicode);
715
722
  var quotes = this.createRegExp(quoteslike.map(q => q[0]), true).source;
716
- this.entry_reg = new RegExp([`[${spaces}]+|${quotes}|[${scopes}]|${this.number_reg.source.replace(/^\^|\$$/g, "")}[^${tokens}]*|${express}|[${stamps}]`], "gi" + flagUnicode);
723
+ this.entry_reg = new RegExp([`[${spaces}]+|${quotes}|[${scopes}]|${number_reg.source.replace(/^\^|\$$/g, "")}[^${tokens}]*|${express}|[${stamps}]`], "gi" + flagUnicode);
717
724
  }
718
725
  }
719
726
  module.exports = Program;
@@ -1,17 +1,49 @@
1
- var { STAMP, STRAP, createString } = require("./common");
1
+ var { STAMP, EXPRESS, snapSentenceHead, pickSentence, createString, getBodyWith } = require("./common");
2
2
  var suggest = {
3
3
  "while($2[$1++]!==$3)": "while($1<$2.length&&$2[$1++]!==$3)",
4
- "while($2[$1]!==$3)$1++": "while($1<$2.length&&$2[$1]!==$3)$1++"
4
+ "while($2[$1]!==$3)$1++": "while($1<$2.length&&$2[$1]!==$3)$1++",
5
+ "arguments"(matched) {
6
+ var m = matched[0];
7
+ var body = getBodyWith(m, 'arguments');
8
+ var head = body.prev;
9
+ if (!head?.length || body.checked) return;
10
+ body.checked = true;
11
+ var { used, args } = body.scoped;
12
+ if (!args?.length) return;
13
+ var broken = false;
14
+ a: for (var a of args) {
15
+ if (!used[a]) {
16
+ continue;
17
+ }
18
+ for (var u of used[a]) {
19
+ if (u.equal) {
20
+ broken = true;
21
+ break a;
22
+ }
23
+ }
24
+ }
25
+ if (!broken) return;
26
+ var h = snapSentenceHead(body);
27
+ var matched = [];
28
+ while (h && h !== body) {
29
+ matched.push(h);
30
+ h = h.next;
31
+ }
32
+ matched.suggest = `${createString(matched.slice(0, matched.length - 1))}(){\r\n var[${createString(head)}]=arguments;\r\n // ${i18n`后续代码`}..\r\n }`;
33
+ return matched;
34
+ }
5
35
  };
6
36
  var roles = Object.keys(suggest).map(s => {
7
37
  var r = scanner2(s);
8
38
  var { used, envs } = r;
9
39
  for (var k in envs) {
10
40
  used[k].forEach(f => {
11
- f.suggest = /^\$\d+$/.test(f.text) ? f.text : null;
41
+ f.sname = /^\$\d+$/.test(f.text) ? f.text : null;
12
42
  });
13
43
  }
14
- r.suggest = scanner2(suggest[s]);
44
+ s = suggest[s];
45
+ if (typeof s === 'string') r.suggest = scanner2(s);
46
+ else r.suggest = s;
15
47
  return r;
16
48
  });
17
49
  var match = function (role, c, nameMap = {}) {
@@ -19,15 +51,15 @@ var match = function (role, c, nameMap = {}) {
19
51
  var matched = [];
20
52
  while (temp) {
21
53
  if (!c || c.type !== temp.type) return;
22
- if (temp.suggest) {
23
- var name = temp.suggest;
54
+ if (temp.sname) {
55
+ var name = temp.sname;
24
56
  if (name in nameMap) {
25
57
  if (nameMap[name] !== c.text) return;
26
58
  }
27
59
  else nameMap[name] = c.text;
28
60
  }
29
61
  else {
30
- if (temp.entry !== c.entry && temp.leave !== c.leave && temp.text !== c.text) return;
62
+ if (temp.entry !== c.entry || temp.leave !== c.leave || temp.text !== c.text) return;
31
63
  if (temp.length) {
32
64
  if (temp.length !== c.length) return;
33
65
  if (!match(temp, c.first, nameMap)) return;
@@ -38,6 +70,8 @@ var match = function (role, c, nameMap = {}) {
38
70
  c = c.next;
39
71
  }
40
72
  if (role.suggest) {
73
+ if (isFunction(role.suggest))
74
+ return role.suggest(matched);
41
75
  var { used } = role.suggest;
42
76
  for (var k in nameMap) {
43
77
  if (used[k]) patchlist('', used[k], nameMap[k]);
@@ -47,6 +81,7 @@ var match = function (role, c, nameMap = {}) {
47
81
  return matched;
48
82
  }
49
83
  var audit = function (code) {
84
+ code.scoped;
50
85
  var checked = [];
51
86
  for (var r of roles) {
52
87
  var rest = [code];
@@ -1,2 +1,16 @@
1
1
  // 执行 efront audit compile/audit_test,检查本文件中的错误
2
- while (body[i] !== b) i++;
2
+ // body中不一定有b
3
+ while (body[i] !== b) i++;
4
+ // 参数有修改并使用了arguments
5
+ function a(a) {
6
+ a = 1;
7
+ console.log(arguments);
8
+ }
9
+
10
+ class a{
11
+ a
12
+ b(c){
13
+ c=2;
14
+ arguments;
15
+ }
16
+ }
@@ -14,7 +14,7 @@ const [
14
14
  /*2048 */ELEMENT,
15
15
  ] = new Array(20).fill(0).map((_, a) => 1 << a);
16
16
  // --------------//1//2/////////////////////////22/////////////2//2//3//4/////4////////3/////3//////3//3//////3///////211/////////////2//////2//////1///
17
- var number_reg = /^(?:(?:0x[0-9a-f]+|0b\d+|0o\d+)(?:_[0-9a-f]+)*|(?:(?:(?:\d+_)*\d+|\d*)\.\d+(?:_\d+)*|(?:\d+_)*\d+\.?))(?:e[\+\-]?\d+(?:_\d+)*|[mniul]|ll)?$/i;
17
+ var number_reg = /^(?:(?:0x[0-9a-f]+|0b\d+|0o\d+|0[0-7]+)(?:_[0-9a-f]+)*|(?:(?:(?:\d+_)*\d+|\d*)\.\d+(?:_\d+)*|(?:\d+_)*\d+\.?))(?:e[\+\-]?\d+(?:_\d+)*|[ijklmnu]+)?/i;
18
18
  var equal_reg = /^(?:[\+\-\*\/~\^&\|%]|\*\*|>>>?|<<)?\=$|^(?:\+\+|\-\-)$/;
19
19
  var needhead_reg = /^\?\.|^\.[^\.]|^\[/;
20
20
  var skipAssignment = function (o, cx) {
@@ -261,6 +261,11 @@ function snapSentenceHead(o) {
261
261
  pp = pp.prev;
262
262
  continue;
263
263
  }
264
+ while (pp?.isprop) {
265
+ o = pp;
266
+ pp = pp.prev;
267
+ if (pp?.isend) break;
268
+ }
264
269
  }
265
270
  break;
266
271
  }
@@ -1193,7 +1198,9 @@ var createString = function (parsed) {
1193
1198
  break;
1194
1199
  default:
1195
1200
  if (o && typeof o === "object") {
1196
- if (intag || o.type === EXPRESS && (needhead_reg.test(o.text) || o.prev?.type === EXPRESS && /\.$/.test(o.prev.text)));
1201
+ if (intag || o.type === EXPRESS && (needhead_reg.test(o.text) || o.prev?.type === EXPRESS && /\.$/.test(o.prev.text))) {
1202
+ if (o.prev?.isdigit && /^\./.test(o.text) && !/^0[\dxbo]|[mni]$|[e\.]/.test(o.prev.text)) result.push(" ");
1203
+ }
1197
1204
  else if ((STRAP | EXPRESS | PROPERTY | COMMENT | VALUE) & lasttype && (STRAP | EXPRESS | PROPERTY | VALUE | LABEL) & o.type) {
1198
1205
  if (autospace) result.push(" ");
1199
1206
  }
@@ -1220,10 +1227,7 @@ var createString = function (parsed) {
1220
1227
  if (patchspace && lasttype !== SPACE) result.push(" ");
1221
1228
  }
1222
1229
  }
1223
- if (o.type === VALUE) {
1224
- if (/^0[0-7]+$/.test(o.text)) {
1225
- o.text = '0o' + o.text.slice(1);
1226
- }
1230
+ if (o.isdigit) {
1227
1231
  if (+o.text < 0 && /\-$/.test(result[result.length - 1])) {
1228
1232
  result.push(" ");
1229
1233
  }
@@ -1443,7 +1447,8 @@ var pickSentence = function (o) {
1443
1447
  } while (h !== e);
1444
1448
  return res;
1445
1449
  };
1446
- var insertBefore = function (o) {
1450
+ var insertBefore = function () {
1451
+ var [o] = arguments;
1447
1452
  var queue = this || o.queue;
1448
1453
  var index = queue.indexOf(o);
1449
1454
  var os = [].slice.call(arguments, 1);
@@ -1461,7 +1466,8 @@ var insertBefore = function (o) {
1461
1466
  if (next) next.prev = o;
1462
1467
  else queue.last = o;
1463
1468
  }
1464
- var insertAfter = function (o) {
1469
+ var insertAfter = function () {
1470
+ var [o] = arguments;
1465
1471
  var queue = this || o.queue;
1466
1472
  var index = queue.indexOf(o) + 1;
1467
1473
  var os = [].slice.call(arguments, 1);
@@ -48,7 +48,7 @@ assert(downLevel(`var {1:a}`), 'var a');
48
48
  assert(downLevel(`var {c:a}`), 'var a');
49
49
  assert(downLevel(`var {a}=b`), 'var a = b.a');
50
50
  assert(downLevel(`var {a}=1`), 'var a = 1 .a');
51
- assert(downLevel(`var {a}=1.1`), 'var a = 1.1 .a');
51
+ assert(downLevel(`var {a}=1.1`), 'var a = 1.1.a');
52
52
  assert(downLevel(`var {c:a}=b`), 'var a = b.c');
53
53
  assert(downLevel(`[...[a]]=[1]`), 'a = [1][0]');
54
54
  assert(downLevel(`[...[a]]=[...[1]]`), 'a = [1][0]');
@@ -184,7 +184,8 @@ class Code extends Array {
184
184
 
185
185
  var avoidMap = null;
186
186
  var typeMap = Object.create(null);
187
- function scan(text, type = "js", lastIndex = 0) {
187
+ function scan() {
188
+ var [text, type = "js", lastIndex = 0] = arguments;
188
189
  if (isFinite(type)) lastIndex = +type, type = arguments[2] || type;
189
190
  var program = typeMap[type];
190
191
  if (!program) switch (type) {
@@ -5,7 +5,8 @@ var execute = function (commName, then, logpad) {
5
5
  window[commName] = null;
6
6
  delete modules[commName];
7
7
  var logs = [];
8
- var log = function (color, type, text, ...extra) {
8
+ var log = function () {
9
+ var [color, type, text, ...extra] = arguments;
9
10
  if (text instanceof Error) text = text.message;
10
11
  window.console.log.apply(window.console, [].slice.call(arguments, 1));
11
12
  logs.push([color, type, text, ...extra]);
@@ -491,8 +491,8 @@ var qrcode = function (typeNumber, errorCorrectionLevel) {
491
491
  return qrHtml;
492
492
  };
493
493
 
494
- _this.createSvgTag = function (cellSize, margin, alt, title) {
495
-
494
+ _this.createSvgTag = function () {
495
+ var [cellSize, margin, alt, title] = arguments;
496
496
  var opts = {};
497
497
  if (typeof arguments[0] == 'object') {
498
498
  // Called by options.
@@ -5,7 +5,7 @@
5
5
  * @param {Function|string} type
6
6
  * @param {Function} listener
7
7
  */
8
- function care(target, type, listener) {
8
+ function care() {
9
9
  var [target, type, listener, allowMultiHandle] = parse.apply(this, arguments);
10
10
  if (!target[type]) {
11
11
  target[type] = [];
@@ -17,7 +17,8 @@ function care(target, type, listener) {
17
17
  listeners.push(listener);
18
18
  }
19
19
  }
20
- function parse(target, type, listener) {
20
+ function parse() {
21
+ var [target, type, listener] = arguments;
21
22
  var allowMultiHandle = arguments[arguments.length - 1];
22
23
  if (typeof allowMultiHandle !== "boolean") {
23
24
  allowMultiHandle = true;
@@ -48,7 +49,7 @@ function parse(target, type, listener) {
48
49
  type = `care(${type})`;
49
50
  return [target, type, listener, allowMultiHandle];
50
51
  }
51
- function clean(target, type, listener) {
52
+ function clean() {
52
53
  var [target, type, listener] = parse.apply(this, arguments);
53
54
  var listeners = target[type];
54
55
  if (listener instanceof Function) {
@@ -1,5 +1,5 @@
1
- function main(elem) {
2
- elem = optionbar.apply(null, arguments);
1
+ function main() {
2
+ var elem = optionbar.apply(null, arguments);
3
3
  var scope = {};
4
4
  if (!elem.childNodes.length) care(elem, function (p) {
5
5
  var [f, data] = p;
@@ -330,7 +330,8 @@ class Point extends Array {
330
330
  return this.value;
331
331
  }
332
332
  }
333
- var createPoints = function (values, direction = "x", result = new Point(0)) {
333
+ var createPoints = function () {
334
+ var [values, direction = "x", result = new Point(0)] = arguments;
334
335
  if (!(values instanceof Array)) values = arguments;
335
336
  for (var cx = 0, dx = values.length; cx < dx; cx++) {
336
337
  var value = values[cx];
@@ -540,7 +540,7 @@ function table(elem) {
540
540
  rowClick(d, i, event) {
541
541
  active(table, i, d, event.target);
542
542
  },
543
- tbody(e) {
543
+ tbody() {
544
544
  var e = list.apply(null, arguments);
545
545
  css(e, tbodyHeight(e, this.hasFoot));
546
546
  css(e, { width: this.adapter.offsetWidth, display: 'block' });
@@ -300,7 +300,8 @@ function prepare(pgpath, ok) {
300
300
  }
301
301
  return url;
302
302
  };
303
- state.init = function (a) {
303
+ state.init = function () {
304
+ var [a] = arguments;
304
305
  a = state.path(a);
305
306
  return init.apply(this, [a].concat([].slice.call(arguments, 1)));
306
307
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efront",
3
- "version": "4.6.3",
3
+ "version": "4.7.1",
4
4
  "description": "简化前端开发,优化web性能",
5
5
  "main": "public/efront.js",
6
6
  "directories": {