efront 4.21.3 → 4.22.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.
Files changed (96) hide show
  1. package/#/345/233/275/351/231/205/345/214/226.yml +117 -66
  2. package/apps/blank/index.html +1 -1
  3. package/apps/index.jsp +76 -27
  4. package/apps/pay/alipay-query.jsp +1 -1
  5. package/apps/pay/alipay.jsp +1 -1
  6. package/apps/pivot/auth/login.js +2 -2
  7. package/apps/pivot/cert/main.xht +18 -5
  8. package/apps/pivot/db/act.xht +53 -0
  9. package/apps/pivot/db/config.xht +56 -16
  10. package/apps/pivot/home/welcome.html +12 -13
  11. package/apps/pivot/home/welcome.js +6 -6
  12. package/apps/pivot/home/welcome.less +12 -3
  13. package/apps/pivot/link/room.js +1 -1
  14. package/apps/pivot/main.js +3 -2
  15. package/apps/pivot/task/invoke.js +3 -3
  16. package/apps/pivot/task/rsync.js +2 -2
  17. package/apps/pivot/wow/root.js +8 -8
  18. package/coms/basic/#loader.js +9 -8
  19. package/coms/basic/Item.js +2 -2
  20. package/coms/basic/Tree.js +14 -2
  21. package/coms/basic/crc.js +5 -1
  22. package/coms/basic/cross_.js +2 -2
  23. package/coms/basic/decode62S.js +44 -0
  24. package/coms/basic/encode62S.js +40 -0
  25. package/coms/basic/encode62S_test.js +18 -0
  26. package/coms/basic/enrich.js +6 -1
  27. package/coms/basic/parseNumber.js +12 -7
  28. package/coms/basic/percent.js +28 -0
  29. package/coms/basic/refilm.js +24 -5
  30. package/coms/basic/refilm_decode.js +46 -22
  31. package/coms/basic/refilm_decode_test.js +5 -0
  32. package/coms/basic/valid.js +4 -0
  33. package/coms/basic_/&Array.js +64 -49
  34. package/coms/basic_/&extends.js +9 -2
  35. package/coms/compile/Html_test.js +5 -0
  36. package/coms/compile/Javascript.js +13 -3
  37. package/coms/compile/Javascript_test.js +3 -0
  38. package/coms/compile/Program.js +119 -43
  39. package/coms/compile/audit.js +23 -1
  40. package/coms/compile/cloneNode.js +3 -1
  41. package/coms/compile/common.js +7 -1
  42. package/coms/compile/downLevel.js +21 -11
  43. package/coms/compile/downLevel_test.js +52 -14
  44. package/coms/compile/rescan.js +8 -2
  45. package/coms/compile/scanner2.js +53 -7
  46. package/coms/compile/translate.js +1 -1
  47. package/coms/compile/unstruct.js +9 -9
  48. package/coms/crypt/encode62.js +36 -6
  49. package/coms/crypt/encode62_test.js +8 -48
  50. package/coms/explorer/main.less +1 -5
  51. package/coms/frame/chat.js +2 -2
  52. package/coms/frame/left.html +5 -4
  53. package/coms/frame/left.js +1 -0
  54. package/coms/frame/left.less +5 -3
  55. package/coms/frame/payment.js +2 -2
  56. package/coms/pivot/acme2.js +7 -4
  57. package/coms/pivot/left-footer.xht +25 -0
  58. package/coms/pivot/pedit.js +3 -3
  59. package/coms/pivot/plist.js +2 -2
  60. package/coms/pivot/qrcode.xht +3 -0
  61. package/coms/zimoli/XMLHttpRequest.js +16 -13
  62. package/coms/zimoli/container.js +34 -34
  63. package/coms/zimoli/design.html +6 -13
  64. package/coms/zimoli/design.js +49 -13
  65. package/coms/zimoli/design.less +62 -25
  66. package/coms/zimoli/drag.js +8 -3
  67. package/coms/zimoli/encode62.js +40 -12
  68. package/coms/zimoli/lattice.js +0 -1
  69. package/coms/zimoli/list.js +0 -8
  70. package/coms/zimoli/menu.js +29 -5
  71. package/coms/zimoli/model.js +150 -195
  72. package/coms/zimoli/model.less +4 -8
  73. package/coms/zimoli/on.js +14 -12
  74. package/coms/zimoli/padding.less +1 -0
  75. package/coms/zimoli/progbar.xht +9 -8
  76. package/coms/zimoli/prompt.less +0 -3
  77. package/coms/zimoli/render.js +210 -125
  78. package/coms/zimoli/select.js +9 -4
  79. package/coms/zimoli/select.less +3 -14
  80. package/coms/zimoli/selectList.js +5 -1
  81. package/coms/zimoli/selectList.less +3 -0
  82. package/coms/zimoli/table.html +7 -7
  83. package/coms/zimoli/table.js +12 -9
  84. package/coms/zimoli/table.less +5 -0
  85. package/coms/zimoli/user.js +2 -2
  86. package/coms/zimoli/view.js +3 -4
  87. package/coms/zimoli/watch.js +3 -1
  88. package/coms/zimoli/zimoli.js +6 -2
  89. package/coms//350/214/250/350/217/260/tab.js +26 -2
  90. package/coms//350/214/250/350/217/260//346/240/207/347/255/276/345/214/226.js +1 -1
  91. package/coms//350/214/250/350/217/260//347/274/226/350/276/221/346/241/206.xht +183 -20
  92. package/docs//345/267/245/345/205/267//345/233/275/351/231/205/345/214/226.xht +5 -0
  93. package/package.json +1 -1
  94. package/public/efront.js +1 -1
  95. package/readme-en.md +3 -5
  96. package/readme.md +3 -4
@@ -35,7 +35,10 @@ var writeField = refilm.writeField = function (data, field, value, offset = fiel
35
35
  var limit = byteLimit;
36
36
  while (limit-- > 0) {
37
37
  v.push(value & 0xff);
38
- value = value >>> 8;
38
+ if (limit >= 4) {
39
+ value = value / 256;
40
+ }
41
+ else value = value >>> 8;
39
42
  }
40
43
  if (value) throw new Error(i18n`数据过大`);
41
44
  value = v;
@@ -56,21 +59,37 @@ var writeFields = refilm.writeFields = function (data, fields, values, offset =
56
59
  };
57
60
  var toint = function (buf) {
58
61
  var n = 0;
59
- for (var cx = 0, dx = buf.length; cx < dx; cx++) {
60
- n += buf[cx] << (cx << 3);
62
+ if (buf.length >= 7 && (buf[7] || buf[6] > 0x1f)) return buf;
63
+ switch (buf.length) {
64
+ default:
65
+ case 3:
66
+ n |= buf[2] << 16;
67
+ case 2:
68
+ n |= buf[1] << 8;
69
+ case 1:
70
+ n |= buf[0];
71
+ case 0:
72
+ }
73
+ for (var cx = 3, dx = buf.length; cx < dx; cx++) {
74
+ n += buf[cx] * 2 ** (cx << 3);
61
75
  }
62
76
  return n;
63
77
  };
64
- var readField = refilm.readField = function (data, field, offset = field.offset, size = field.size * field.ratio) {
78
+ var readBuffer = refilm.readBuffer = function (data, field, offset = field.offset, size = field.size * field.ratio) {
65
79
  return data.slice(offset, offset + size);
66
80
  };
67
81
 
82
+ var readField = refilm.readField = function (data, field, offset, size) {
83
+ var v = readBuffer(data, field, offset, size);
84
+ if (/^([us]?int|byte|word|dword|qword|long)/i.test(field.type)) v = toint(v);
85
+ return v;
86
+ };
87
+
68
88
  refilm.readFields = function (data, fields, offset = fields.offset || 0) {
69
89
  var res = Object.create(null);
70
90
  for (var f of fields) {
71
91
  var size = f.size * f.ratio;
72
92
  var v = readField(data, f, offset, size);
73
- if (size <= 4) v = toint(v);
74
93
  res[f.key] = v;
75
94
  offset += size;
76
95
  }
@@ -1,7 +1,7 @@
1
1
  "use ./KMGT.txt"
2
2
  function scanBlock(piece) {
3
3
  if (!piece) return [];
4
- var reg = /\\[\s\S]|^\s*[#\-]\s*|\s+|"|'/mg;
4
+ var reg = /\\[\s\S]|^\s*[#\-]\s*|\s+|"|'|\^/mg;
5
5
  var res = [];
6
6
  var lastIndex = 0;
7
7
  var save = function (a) {
@@ -18,13 +18,19 @@ function scanBlock(piece) {
18
18
  });
19
19
  res.push(a);
20
20
  };
21
+ var avoid = false;
21
22
  for (var cx = 0, dx = piece.length; cx < dx; cx++) {
22
23
  reg.lastIndex = cx;
23
24
  var m = reg.exec(piece);
24
25
  if (m) {
25
26
  var s = m[0];
26
- if (/^\s+$/.test(s)) {
27
- save(piece.slice(lastIndex, reg.lastIndex));
27
+ if (/^(\s+|\^)$/.test(s)) {
28
+ if (s === '^') {
29
+ avoid = res.length;
30
+ }
31
+ else {
32
+ save(piece.slice(lastIndex, reg.lastIndex));
33
+ }
28
34
  lastIndex = reg.lastIndex;
29
35
  } else if (/^["']$/i.test(s)) {
30
36
  var i = piece.indexOf(s, cx + 1);
@@ -39,6 +45,7 @@ function scanBlock(piece) {
39
45
  break;
40
46
  }
41
47
  }
48
+ if (avoid !== false) res.avoid = avoid;
42
49
  return res;
43
50
  }
44
51
 
@@ -262,7 +269,22 @@ function spreadkey(name) {
262
269
  }
263
270
  return [name, key, needs, holder];
264
271
  }
272
+ function parseOptions(options) {
273
+ if (typeof options === "string" && !/^[\$#]+\d+$/.test(options)) {
274
+ var needUnfold = /^\[|\]$/.test(options);
275
+ options = options.replace(/^\[|\]$/g, '');
276
+ if (needUnfold || /,/.test(options)) options = scanSlant(options, ',');
277
+ else options = scanSlant(options, "");
278
+ if (needUnfold) unfoldOptions(size, options);
279
+ }
280
+ return options;
281
+ }
265
282
  function parse(piece) {
283
+ var avoid1 = null;
284
+ if (piece.avoid != null) {
285
+ avoid1 = piece[piece.avoid];
286
+ piece.splice(piece.avoid, 1);
287
+ }
266
288
  if (/^[\-#]+$/.test(piece[0])) {
267
289
  var piece0 = piece.pop();
268
290
  piece[0] = piece0 + (piece[0] || '').trim();
@@ -293,7 +315,8 @@ function parse(piece) {
293
315
  holder,
294
316
  do: action,
295
317
  editable,
296
- needs, checks, repeat, endwith,
318
+ avoid,
319
+ needs, valid, repeat, endwith,
297
320
  required, inlist, hidden, readonly,
298
321
  delete_onempty, delete_onsubmit,
299
322
  } = name;
@@ -338,9 +361,13 @@ function parse(piece) {
338
361
  [name, key, needs, holder] = spreadkey(name);
339
362
  if (key === undefined && !/^(title|label|headline)$/i.test(type)) key = name;
340
363
  }
341
- if (/^[a-z\d]+\/?\d+$/i.test(type)) {
364
+ var value = /\/?\=([^\/\\]+)/.exec(type);
365
+ if (value) type = type.slice(0, value.index) + type.slice(value.index + value[0].length), value = parseValue(value[1]);
366
+ if (/^[a-z]+(\d+|\d*\/\d+)$/i.test(type)) {
342
367
  let [_, t, d] = /^(\w*?)\/?(\d+)$/.exec(type);
343
- type = d + 'bit/' + t;
368
+ if (_.length === t.length + d.length) t = _;
369
+ if (d & 0b111 === 0) type = (d >>> 3) + 'byte/' + t;
370
+ else type = d + 'bit/' + t;
344
371
  }
345
372
  var sizematch = /^(\-?\d+|\-?\d*\.\d+)?([YZEPTGMK]i?b?|bytes?|bits?|words?|dword|real[48]|long|B|[^\/]*)([\/]|$|\s|\=)/i.exec(type);
346
373
  if (!sizematch[1] && /^\$\d/.test(sizematch[2])) sizematch = null;
@@ -412,18 +439,12 @@ function parse(piece) {
412
439
  } else if (/^[\/]/.test(type)) {
413
440
  type = type.slice(1);
414
441
  }
415
- if (typeof options === "string" && !/^[\$#]+\d+$/.test(options)) {
416
- var editable = false;
417
- if (/^[\+\-\*]|[\+\-\*]$/.test(options)) {
418
- editable = true;
419
- options = options.replace(/^[\+\-\*]|[\+\*\-]$/g, '');
420
- }
421
- var needUnfold = /^\[|\]$/.test(options);
422
- options = options.replace(/^\[|\]$/g, '');
423
- if (needUnfold || /,/.test(options)) options = scanSlant(options, ',');
424
- else options = scanSlant(options, "");
425
- if (needUnfold) unfoldOptions(size, options);
442
+ if (typeof options === 'string' && /^[\+\-\*]|[\+\-\*]$/.test(options)) {
443
+ editable = true;
444
+ options = options.replace(/^[\+\-\*]|[\+\*\-]$/g, '');
426
445
  }
446
+ options = parseOptions(options);
447
+ avoid = parseOptions(avoid1 || avoid);
427
448
  name = is(name);
428
449
  key = is(key);
429
450
  }
@@ -436,8 +457,9 @@ function parse(piece) {
436
457
  name, type, key, value, comment, options,
437
458
  editable,
438
459
  size, unit, ratio, holder,
439
- needs, checks, repeat, endwith,
460
+ needs, valid, repeat, endwith,
440
461
  required, inlist, hidden, readonly,
462
+ avoid,
441
463
  do: action,
442
464
  delete_onempty, delete_onsubmit,
443
465
  };
@@ -477,11 +499,13 @@ function refilm_decode(str) {
477
499
  if (!m) break;
478
500
  var piece = s.slice(lastIndex, m.index);
479
501
  piece = scanBlock(piece);
502
+ if (piece.avoid != null) {
503
+ rest.avoid = rest.length + piece.avoid;
504
+ }
505
+ if (piece) rest.push.apply(rest, piece);
480
506
  if (m[0].length || cx + 1 === dx) {
481
- result.push(rest.concat(piece));
482
- rest.splice(0, rest.length);
483
- } else {
484
- if (piece) rest.push.apply(rest, piece);
507
+ result.push(rest);
508
+ rest = [];
485
509
  }
486
510
  lastIndex = m.index + m[0].length;
487
511
  } while (lastIndex < s.length);
@@ -6,6 +6,7 @@ var test = function (fields, key, expect) {
6
6
  if (!valid) console.log(fields)
7
7
  };
8
8
  test(refilm`启动时间/time $1`, 'key', 'time');
9
+ test(refilm`启动时间/time int64/=1`, 'type', 'int64');
9
10
  test(refilm`启动时间/time $1`, 'type', '$1');
10
11
  test(refilm`启动时间/time ${test}`, 'key', "time");
11
12
  test(refilm`启动时间/time ${test}`, 'type', test);
@@ -17,3 +18,7 @@ test(refilm`连城剑法 别名 [唐诗剑法,躺尸剑法]`, ['options', 1, 'na
17
18
  test(refilm`连城剑法 别名 [唐诗剑法,躺尸剑法]`, ['options', 1, 'key'], "躺尸剑法");
18
19
  test(refilm`连城剑法 别名 [唐诗剑法,躺尸剑法]`, ['options', 1, 'value'], 1);
19
20
  test(refilm`连城剑法 别名 [唐诗剑法/0,躺尸剑法/1]`, ['options', 1, 'key'], 1);
21
+ test(refilm`连城剑法 别名 ^[唐诗剑法/0,躺尸剑法/1]`, ['avoid', 1, 'key'], 1);
22
+ test(refilm`连城剑法 别名 [唐诗剑法/0,躺尸剑法/1] ^[a,b]`, ['options', 1, 'key'], 1);
23
+ test(refilm`连城剑法 别名 [唐诗剑法/0,躺尸剑法/1] ^[a,b]`, ['avoid', 1, 'key'], 'b');
24
+ test(refilm`连城剑法 别名 [唐诗剑法/0,躺尸剑法/1] ^${[{ key: 'a' }, { key: 'c' }]}`, ['avoid', 1, 'key'], 'c');
@@ -14,6 +14,10 @@ function valid(field, data) {
14
14
  }
15
15
  return;
16
16
  }
17
+ if (field.avoid) for (var a of field.avoid) {
18
+ if (a === data) continue;
19
+ if (a[field.key] === data[field.key]) return i18n`已存在${field.name}为${data[field.key]}的项`;
20
+ }
17
21
  var tmp = validators[field.type];
18
22
  if (tmp) {
19
23
  var value = data[field.key];
@@ -1,67 +1,82 @@
1
- var hasOwnProperty = {}.__proto__ === Object ? function (k) {
1
+ var hasOwnProperty = {}.__proto__ === Object.prototype ? function (k) {
2
2
  var proto = this.__proto__;
3
3
  return k in this && (!proto || !(k in proto));
4
4
  } : Object.prototype.hasOwnProperty;
5
5
  var setPrototypeOf = Object.setPrototypeOf;
6
+ var wrapMethod = function (f) {
7
+ return function () {
8
+ var res = f.apply(this, arguments);
9
+ setPrototypeOf(res, this.constructor.prototype);
10
+ return res;
11
+ }
12
+ };
6
13
  a: if (!setPrototypeOf) {
7
- var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
8
- var getOwnPropertyNames = Object.getOwnPropertyNames;
9
- var defineProperty = Object.defineProperty;
10
- try {
11
- if (!getOwnPropertyNames) throw i18n`不支持`;
12
- defineProperty({}, 'o', { value: 0 });
14
+ if ({}.__proto__ === Object.prototype) {
13
15
  setPrototypeOf = function (obj, proto) {
14
- var names = getOwnPropertyNames(proto)
15
- for (var n of names) {
16
- var d = getOwnPropertyDescriptor(proto, n);
17
- defineProperty(obj, n, d);
18
- }
19
- return obj;
16
+ obj.__proto__ = proto;
20
17
  }
21
- break a;
22
- } catch (e) {
23
- getOwnPropertyDescriptor = null;
24
- defineProperty = null;
25
- getOwnPropertyNames = null;
26
18
  }
27
- // <!--
28
- console.error(i18n`当前运行环境使用class extends Array会有难以解决的不兼容性问题,请更换代码的实现方式!`);
29
- // -->
30
- setPrototypeOf = function (obj, proto) {
31
- for (var p in proto) if (hasOwnProperty.call(proto, p) && !(p in obj)) obj[p] = proto[p];
32
- obj.constructor = proto.constructor;
33
- return obj;
19
+ else if (Object.getOwnPropertyDescriptors) {
20
+ setPrototypeOf = function (obj, proto) {
21
+ var descriptors = Object.getOwnPropertyDescriptors(proto);
22
+ Object.defineProperties(obj, descriptors);
23
+ }
34
24
  }
35
- }
36
- var wrapMethod = method => function () {
37
- var res = method.apply(this, arguments);
38
- var res0 = this.constructor.apply(this, []);
39
- res0.length = res.length;
40
- for (var k in res) {
41
- k = +k;
42
- if ((k & 0x7fffffff) !== k) break;
43
- res0[k] = res[k];
25
+ else {
26
+
27
+ if (Object.getOwnPropertyNames) {
28
+ setPrototypeOf = function (obj, proto) {
29
+ var keys = Object.getOwnPropertyNames(proto);
30
+ methods.forEach(k => {
31
+ obj[k] = wrapMethod(proto[k]);
32
+ });
33
+ keys.forEach(k => {
34
+ var dp = Object.getOwnPropertyDescriptor(proto, k);
35
+ Object.defineProperty(obj, k, dp);
36
+ })
37
+ obj.constructor = proto.constructor;
38
+ return obj;
39
+ }
40
+ }
41
+ else {
42
+ // <!--
43
+ console.error(i18n`当前运行环境使用class extends Array会有难以解决的不兼容性问题,请更换代码的实现方式!`);
44
+ // -->
45
+ setPrototypeOf = function (obj, proto) {
46
+ var keys = Object.keys(proto);
47
+ methods.forEach(k => {
48
+ obj[k] = wrapMethod(proto[k]);
49
+ });
50
+ obj.constructor = proto.constructor;
51
+ keys.forEach(k => {
52
+ if (!(k in obj)) obj[k] = proto[k];
53
+ })
54
+ return obj;
55
+ }
56
+ }
44
57
  }
45
- return res0;
46
- };
47
- var map = wrapMethod([].map);
48
- var slice = wrapMethod([].slice);
49
- var filter = wrapMethod([].filter);
50
- var splice = wrapMethod([].splice);
51
- var concat = wrapMethod([].concat);
58
+ }
52
59
 
53
60
  function Array2() {
54
- var proto = this.constructor.prototype;
61
+ var res = Array.apply(this, arguments);
55
62
  /**
56
63
  * @type {PropertyDescriptor}
57
64
  */
58
- if (!hasOwnProperty.call(proto, 'map')) proto.map = map;
59
- if (!hasOwnProperty.call(proto, 'slice')) proto.slice = slice;
60
- if (!hasOwnProperty.call(proto, 'filter')) proto.filter = filter;
61
- if (!hasOwnProperty.call(proto, 'splice')) proto.splice = splice;
62
- if (!hasOwnProperty.call(proto, 'concat')) proto.concat = concat;
63
- var obj = setPrototypeOf(Array.apply(this, arguments), proto);
64
- return obj;
65
+ setPrototypeOf(res, this.constructor.prototype);
66
+ return res;
65
67
  }
68
+ var methods = [
69
+ 'concat',
70
+ 'slice',
71
+ 'splice',
72
+ 'filter',
73
+ 'flat',
74
+ 'flatMap',
75
+ 'map',
76
+ 'toReversed',
77
+ 'toSorted',
78
+ 'toSpliced',
79
+ 'with',
80
+ ].filter(k => k in Array.prototype);
66
81
  Array2.prototype = Array.prototype;
67
82
  return Array2;
@@ -2,14 +2,21 @@ var __static = Object.setPrototypeOf || { __proto__: [] } instanceof Array && fu
2
2
  d.__proto__ = b;
3
3
  } || extend;
4
4
  var setConstructor = Object.defineProperty ? function (a, c) {
5
- Object.defineProperty(a, "constructor", { value: c });
5
+ try {
6
+ Object.defineProperty(a, "constructor", { value: c });
7
+ } catch (e) {
8
+ setConstructor = function (a, c) {
9
+ a.constructor = c;
10
+ };
11
+ setConstructor(a, c);
12
+ }
6
13
  } : function (a, c) {
7
14
  a.constructor = c;
8
15
  };
9
16
  // class A extends B {}
10
17
  function extends_(A, B) {
18
+ A.prototype = B === null ? Object.create(null) : (_ = new B, setConstructor(_, A), _);
11
19
  __static(A, B);
12
- A.prototype = B === null ? Object.create(null) : new (_ = function () { setConstructor(this, A) }, _.prototype = B.prototype, _);
13
20
  var _;
14
21
  }
15
22
  return extends_;
@@ -37,6 +37,11 @@ test('${i18n`加载中..`}<div class="loader"></div>');
37
37
  test('${a +typeof i18n`加载中..`}<div class="loader"></div>', '${a + typeof i18n`加载中..`}<div class="loader"></div>');
38
38
  test('${a > 1}');
39
39
  test('a>1', 'a > 1');
40
+ test('a<1>>1', 'a < 1 >> 1');
41
+ test('a<b>>1', 'a < b >> 1');
42
+ test('a < b >> 1', '1.type', 8);
43
+ test('a < z >> 1', '2.type', 128);
44
+ test('a<<z>1', 'a << z > 1');
40
45
  test(`<meta charset="utf-8" />`);
41
46
  test('a><a></a>', 'a > <a></a>');
42
47
  test('X', 'X');
@@ -2,7 +2,7 @@
2
2
  var strings = require("../basic/strings");
3
3
  var Program = require("./Program");
4
4
  var backEach = require("../basic/backEach");
5
-
5
+ var parseNumber = require('../basic/parseNumber');
6
6
  const {
7
7
  /* 1 */COMMENT,
8
8
  /* 2 */SPACE,
@@ -43,7 +43,7 @@ instanceof`.trim().split(/[,\s]+/);
43
43
  var colonstrap_reg = /^(case|default)$/;
44
44
  class Javascript extends Program {
45
45
  straps = straps;
46
- value_reg = /^(false|true|null|Infinity|NaN|undefined|eval)$/
46
+ value_reg = /^(false|true|null|Infinity|NaN|undefined|eval|this|arguments)$/
47
47
  transive_reg = /^(new|var|let|const|yield|void|in|of|typeof|delete|case|return|await|instanceof|throw|extends|import|from)$/
48
48
  strapexp_reg = /^(new|void|typeof|delete|class|function|await)/;
49
49
  forceend_reg = /^(return|yield|break|continue|debugger|async)$/;
@@ -172,7 +172,9 @@ var fixType = function (o) {
172
172
  if (last && last.type === EXPRESS && /[^\.]\.$/.test(last.text)) {
173
173
  type = EXPRESS;
174
174
  }
175
- else if (isProperty(o)) type = PROPERTY;
175
+ else if (isProperty(o)) {
176
+ if (!o.isdigit) type = PROPERTY;
177
+ }
176
178
  else if (m === 'from') {
177
179
  if (!last || last.type === STRAP && !/^(im|ex)port$/.test(last.text)) {
178
180
  type = EXPRESS;
@@ -621,6 +623,14 @@ function detour(o, ie) {
621
623
  if (/^0[0-7]+$/.test(o.text)) {
622
624
  o.text = '0o' + o.text.slice(1);
623
625
  }
626
+ if (o.isprop) {
627
+ if ((o.isdigit)) {
628
+ var value = parseNumber(o.text);
629
+ if (Number.isNaN(value) || value < 0)
630
+ console.warn(i18n`发现异常属性:${`<yellow>${o.text}</yellow>`}`);
631
+ else o.text = String(value);
632
+ }
633
+ }
624
634
  break;
625
635
  case QUOTED:
626
636
  if (o.length) {
@@ -26,6 +26,9 @@ var testDetour = function (a, e) {
26
26
  c.break();
27
27
  assert(c.toString(), e);
28
28
  }
29
+ testDetour('={0x1:1}', '= { 1: 1 }')
30
+ testDetour('={-0x1:1}', '= { -0x1: 1 }')
31
+ testDetour('={false:1}', '= { ["false"]: 1 }')
29
32
  testDetour('1.1', '1.1')
30
33
  testDetour('1.1.a', '1.1["a"]')
31
34
  testDetour('-1e10.a', '-1e10["a"]')