efront 4.6.1 → 4.7.0

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
  }
@@ -29,6 +29,7 @@ const {
29
29
  replace,
30
30
  skipAssignment,
31
31
  insertAfter,
32
+ pickSentence,
32
33
  unshort,
33
34
  } = require("./common");
34
35
  var straps = `if,in,do,as,of
@@ -345,7 +346,6 @@ Javascript.prototype.setType = function (o) {
345
346
  if (this.detectLabel(o)) return false;
346
347
  var last = o.prev;
347
348
  if (o.type === EXPRESS && /^\.[^\.]|^\.$/.test(o.text) && last && last.type === STAMP && last.text === "?") {
348
- last = o.prev = snapExpressHead(last.prev);
349
349
  last.type = EXPRESS;
350
350
  return false;
351
351
  }
@@ -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,8 +14,9 @@ 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
+ var needhead_reg = /^\?\.|^\.[^\.]|^\[/;
19
20
  var skipAssignment = function (o, cx) {
20
21
  if (!o) return;
21
22
  var next = arguments.length === 1 ? function () {
@@ -100,7 +101,7 @@ var skipAssignment = function (o, cx) {
100
101
  next();
101
102
  break;
102
103
  case EXPRESS:
103
- if (/^\.[^\.]/.test(o.text)) {
104
+ if (needhead_reg.test(o.text)) {
104
105
  next();
105
106
  break;
106
107
  }
@@ -260,6 +261,11 @@ function snapSentenceHead(o) {
260
261
  pp = pp.prev;
261
262
  continue;
262
263
  }
264
+ while (pp?.isprop) {
265
+ o = pp;
266
+ pp = pp.prev;
267
+ if (pp?.isend) break;
268
+ }
263
269
  }
264
270
  break;
265
271
  }
@@ -344,7 +350,7 @@ var snapExpressHead = function (o) {
344
350
  if (h) return h;
345
351
  }
346
352
  if (o.type === SCOPED && o.entry !== '{'
347
- || o.type === EXPRESS && /^(\??\.[^\.]|\[)/.test(o.text)
353
+ || o.type === EXPRESS && needhead_reg.test(o.text)
348
354
  || /\.$/.test(p.text) && !p.isdigit
349
355
  || o.type === QUOTED && (o.length || /^\`/.test(o.text))
350
356
  ) {
@@ -416,7 +422,7 @@ var snapExpressFoot = function (o) {
416
422
  if (!n) break;
417
423
  if (n.type === SCOPED && (o.entry !== '{' || isExpress)
418
424
  || /\.$/.test(o.text) && !o.isdigit
419
- || n.type === EXPRESS && /^\??\.[^\.]/.test(n.text)
425
+ || n.type === EXPRESS && needhead_reg.test(n.text)
420
426
  || n.type === QUOTED && (n.length || /^\`/.test(n.text))
421
427
  ) {
422
428
  o = n;
@@ -1063,7 +1069,7 @@ var createString = function (parsed) {
1063
1069
  || prev.type === STAMP && !prev.unary
1064
1070
  ) {
1065
1071
  if (intag || prev.type === ELEMENT && o.type === ELEMENT) break a;
1066
- if (o.type !== EXPRESS || !/^(\.[^\.]|\[)/.test(o.text) && !prev.tag && !o.tag) {
1072
+ if (o.type !== EXPRESS || !needhead_reg.test(o.text) && !prev.tag && !o.tag) {
1067
1073
  result.push(" ");
1068
1074
  lasttype = SPACE
1069
1075
  }
@@ -1192,7 +1198,9 @@ var createString = function (parsed) {
1192
1198
  break;
1193
1199
  default:
1194
1200
  if (o && typeof o === "object") {
1195
- if (intag || o.prev && o.prev.type === EXPRESS && o.type === EXPRESS && (/^[\.\[]/.test(o.text) || /\.$/.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
+ }
1196
1204
  else if ((STRAP | EXPRESS | PROPERTY | COMMENT | VALUE) & lasttype && (STRAP | EXPRESS | PROPERTY | VALUE | LABEL) & o.type) {
1197
1205
  if (autospace) result.push(" ");
1198
1206
  }
@@ -1219,10 +1227,7 @@ var createString = function (parsed) {
1219
1227
  if (patchspace && lasttype !== SPACE) result.push(" ");
1220
1228
  }
1221
1229
  }
1222
- if (o.type === VALUE) {
1223
- if (/^0[0-7]+$/.test(o.text)) {
1224
- o.text = '0o' + o.text.slice(1);
1225
- }
1230
+ if (o.isdigit) {
1226
1231
  if (+o.text < 0 && /\-$/.test(result[result.length - 1])) {
1227
1232
  result.push(" ");
1228
1233
  }
@@ -1442,7 +1447,8 @@ var pickSentence = function (o) {
1442
1447
  } while (h !== e);
1443
1448
  return res;
1444
1449
  };
1445
- var insertBefore = function (o) {
1450
+ var insertBefore = function () {
1451
+ var [o] = arguments;
1446
1452
  var queue = this || o.queue;
1447
1453
  var index = queue.indexOf(o);
1448
1454
  var os = [].slice.call(arguments, 1);
@@ -1460,7 +1466,8 @@ var insertBefore = function (o) {
1460
1466
  if (next) next.prev = o;
1461
1467
  else queue.last = o;
1462
1468
  }
1463
- var insertAfter = function (o) {
1469
+ var insertAfter = function () {
1470
+ var [o] = arguments;
1464
1471
  var queue = this || o.queue;
1465
1472
  var index = queue.indexOf(o) + 1;
1466
1473
  var os = [].slice.call(arguments, 1);
@@ -1484,7 +1491,7 @@ var unshort = function (o, text) {
1484
1491
  o.type = EXPRESS;
1485
1492
  delete o.short;
1486
1493
  };
1487
- var getScopeWith = function (o, k) {
1494
+ var getBodyWith = function (o, k) {
1488
1495
  var q = o.queue;
1489
1496
  while (q && (!q.scoped || !q.scoped.used[k])) q = q.queue;
1490
1497
  return q;
@@ -1493,13 +1500,13 @@ var getScopeWith = function (o, k) {
1493
1500
  var patchArrawScope = function (arraw, origin) {
1494
1501
  var s1 = createScoped(arraw);
1495
1502
  if (s1.used.this) {
1496
- var s = getScopeWith(origin, 'this').scoped;
1503
+ var s = getBodyWith(origin, 'this').scoped;
1497
1504
  s.used.this.push(...s1.used.this);
1498
1505
  s.insett = true;
1499
1506
  }
1500
1507
  if (s1.used.arguments) {
1501
1508
  s.inseta = true;
1502
- var s = getScopeWith(origin, 'arguments').scoped;
1509
+ var s = getBodyWith(origin, 'arguments').scoped;
1503
1510
  s.used.arguments.push(...s1.used.arguments);
1504
1511
  };
1505
1512
  };
@@ -1522,7 +1529,7 @@ module.exports = {
1522
1529
  unshort,
1523
1530
  skipAssignment,
1524
1531
  getDeclared,
1525
- getScopeWith,
1532
+ getBodyWith,
1526
1533
  patchArrawScope,
1527
1534
  remove,
1528
1535
  createString,
@@ -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.1",
3
+ "version": "4.7.0",
4
4
  "description": "简化前端开发,优化web性能",
5
5
  "main": "public/efront.js",
6
6
  "directories": {