efront 4.21.4 → 4.22.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.
Files changed (90) hide show
  1. package/#/345/233/275/351/231/205/345/214/226.yml +24 -0
  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/refilm_decode.js +40 -20
  28. package/coms/basic/refilm_decode_test.js +4 -0
  29. package/coms/basic/valid.js +4 -0
  30. package/coms/basic_/&Array.js +64 -49
  31. package/coms/basic_/&extends.js +9 -2
  32. package/coms/compile/Javascript.js +1 -1
  33. package/coms/compile/audit.js +23 -1
  34. package/coms/compile/cloneNode.js +3 -1
  35. package/coms/compile/downLevel.js +21 -11
  36. package/coms/compile/downLevel_test.js +52 -14
  37. package/coms/compile/rescan.js +8 -2
  38. package/coms/compile/unstruct.js +9 -9
  39. package/coms/crypt/encode62.js +36 -6
  40. package/coms/crypt/encode62_test.js +8 -48
  41. package/coms/explorer/main.less +1 -5
  42. package/coms/frame/chat.js +2 -2
  43. package/coms/frame/left.html +5 -4
  44. package/coms/frame/left.js +1 -0
  45. package/coms/frame/left.less +5 -3
  46. package/coms/frame/payment.js +2 -2
  47. package/coms/pivot/acme2.js +7 -4
  48. package/coms/pivot/left-footer.xht +25 -0
  49. package/coms/pivot/pedit.js +3 -3
  50. package/coms/pivot/plist.js +2 -2
  51. package/coms/pivot/qrcode.xht +3 -0
  52. package/coms/zimoli/XMLHttpRequest.js +2 -2
  53. package/coms/zimoli/container.js +34 -34
  54. package/coms/zimoli/design.html +6 -13
  55. package/coms/zimoli/design.js +49 -13
  56. package/coms/zimoli/design.less +62 -25
  57. package/coms/zimoli/drag.js +8 -3
  58. package/coms/zimoli/encode62.js +40 -12
  59. package/coms/zimoli/lattice.js +0 -1
  60. package/coms/zimoli/list.js +0 -8
  61. package/coms/zimoli/menu.js +29 -5
  62. package/coms/zimoli/menuList.js +1 -0
  63. package/coms/zimoli/menuList_test.js +1 -0
  64. package/coms/zimoli/model.js +150 -195
  65. package/coms/zimoli/model.less +4 -8
  66. package/coms/zimoli/on.js +14 -12
  67. package/coms/zimoli/padding.less +1 -0
  68. package/coms/zimoli/progbar.xht +9 -8
  69. package/coms/zimoli/prompt.less +0 -3
  70. package/coms/zimoli/render.js +210 -125
  71. package/coms/zimoli/select.js +9 -4
  72. package/coms/zimoli/select.less +3 -14
  73. package/coms/zimoli/selectList.js +5 -1
  74. package/coms/zimoli/selectList.less +3 -0
  75. package/coms/zimoli/table.html +7 -7
  76. package/coms/zimoli/table.js +12 -9
  77. package/coms/zimoli/table.less +5 -0
  78. package/coms/zimoli/tree.js +1 -2
  79. package/coms/zimoli/tree.less +3 -1
  80. package/coms/zimoli/tree_test.js +8 -6
  81. package/coms/zimoli/user.js +2 -2
  82. package/coms/zimoli/view.js +3 -4
  83. package/coms/zimoli/watch.js +3 -1
  84. package/coms/zimoli/zimoli.js +7 -3
  85. package/coms//350/214/250/350/217/260/tab.js +26 -2
  86. package/coms//350/214/250/350/217/260//346/240/207/347/255/276/345/214/226.js +1 -1
  87. package/coms//350/214/250/350/217/260//347/274/226/350/276/221/346/241/206.xht +183 -20
  88. package/docs//345/267/245/345/205/267//345/233/275/351/231/205/345/214/226.xht +1 -0
  89. package/package.json +1 -1
  90. package/public/efront.js +1 -1
@@ -355,7 +355,7 @@ var killdec = function (queue, i, getobjname, _var = 'var', killobj, islet) {
355
355
  else {
356
356
  var objname = getobjname(0);
357
357
  q = scanner2(`(${objname} =)`);
358
- q[0].push(...splice(queue, i, i2));
358
+ q[0].push(...splice(queue, i, i2 - i));
359
359
  q[0].push(...scanner2(`${a[0]},${objname}!== undefined ? ${objname}: `), ...splice2(a[2], a[3], a[4]));
360
360
  i2 = i;
361
361
  }
@@ -365,7 +365,7 @@ var killdec = function (queue, i, getobjname, _var = 'var', killobj, islet) {
365
365
  }
366
366
  }
367
367
  tmpname = getobjname(0);
368
- if (i > i0) splice(queue, i++, 0, { type: STAMP, text: ',' }, { type: EXPRESS, text: tmpname }, { type: STAMP, text: "=" });
368
+ if (index > 0) splice(queue, i++, 0, { type: STAMP, text: ',' }, { type: EXPRESS, text: tmpname }, { type: STAMP, text: "=" });
369
369
  else splice(queue, i, 0, { type: EXPRESS, text: tmpname }, { type: STAMP, text: "=" });
370
370
  i += 2;
371
371
  var i2 = skipAssignment(queue, i);
@@ -591,7 +591,7 @@ var setprop = function (prop, k, d, q, tempname) {
591
591
  tmp = tmp[tmp.length - 1];
592
592
  d[prop.name] = tmp;
593
593
  }
594
- insert1(d[prop.name], null, ...rescan`[${prop.get ? '"get"' : '"set"'}]=${pv},${tempname}`);
594
+ insert1(d[prop.name], null, ...rescan.keep`[${prop.get ? '"get"' : '"set"'}]=${pv},${tempname}`);
595
595
  }
596
596
  else {
597
597
  insert1(q, null, ...scanner2(`${q && q.length ? "\r\n" : ''}${k}${prop.name}=`));
@@ -599,7 +599,7 @@ var setprop = function (prop, k, d, q, tempname) {
599
599
  }
600
600
  }
601
601
  var rootenvs = null, rootHyper;
602
- var killcls = function (body, i, letname_, getname_) {
602
+ var killcls = function (body, i, letname_, getname_, killobj) {
603
603
  var extends_ = [];
604
604
  var o = body[i];
605
605
  var ishalf = isHalfSentence(body, i - 1);
@@ -651,6 +651,7 @@ var killcls = function (body, i, letname_, getname_) {
651
651
  while (m) {
652
652
  var [prop, m] = getprop(o, m);
653
653
  if (!prop.value.length) prop.value = scanner2('undefined;');
654
+ else if (!prop.sfunc) killobj(prop.value);
654
655
  var k = prop.static ? clz.name : `${clz.name}["prototype"]`;
655
656
  var d = prop.static ? static_ : define_;
656
657
  if (prop.get || prop.set || prop.static) {
@@ -683,14 +684,18 @@ var killcls = function (body, i, letname_, getname_) {
683
684
  if (isExpress) fname[0].isExpress = true;
684
685
  insert1(invokes, null, ...fname);
685
686
  if (base) {
686
- constructor[1].push(...scanner2('return this'))
687
+ var retthis = 'return this';
688
+ if (assign.length && assign.last.type !== SPACE && assign.last.text !== ';') {
689
+ retthis = "\r\n" + retthis;
690
+ }
691
+ constructor[1].push(...scanner2(retthis))
687
692
  relink(constructor[1]);
688
693
  var cs = createScoped(constructor[1]);
689
694
  var newt = getname(cs.vars, cs.envs, 'this_');
690
695
  if (cs.caps.this) rename(cs.caps, 'this', newt);
691
696
  var inited = false;
692
697
  assign.forEach(o => {
693
- if (o.type === EXPRESS) o.text = o.text.replace(/^this([\[\.]|$)/g, newt + "$1");
698
+ if (o.type === EXPRESS || o.type === VALUE && !o.isdigit) o.text = o.text.replace(/^this([\[\.]|$)/g, newt + "$1");
694
699
  });
695
700
  if (cs.caps.super) {
696
701
  cs.caps.super.forEach(o => {
@@ -704,7 +709,7 @@ var killcls = function (body, i, letname_, getname_) {
704
709
  inited = true;
705
710
  insert1(o.queue, o, ...scanner2(`var ${newt}=`));
706
711
  if (n.length) n.unshift({ type: STAMP, text: ',' });
707
- n.unshift({ type: EXPRESS, text: 'this' });
712
+ n.unshift({ type: VALUE, text: 'this' });
708
713
  insert1(o.queue, n.next, ...scanner2(`||this;`));
709
714
  })
710
715
  }
@@ -984,7 +989,7 @@ var killobj = function (body, getobjname, getletname, getname_, letname_, deep =
984
989
  i++;
985
990
  break;
986
991
  case "class":
987
- i = killcls(body, i, letname_, getname_);
992
+ i = killcls(body, i, letname_, getname_, deepkill);
988
993
  break;
989
994
  case "for":
990
995
  case "function":
@@ -1042,6 +1047,11 @@ var killobj = function (body, getobjname, getletname, getname_, letname_, deep =
1042
1047
  continue;
1043
1048
  }
1044
1049
  else if (o.entry === '(') {
1050
+ var arg = o.last;
1051
+ if (arg?.type === STAMP && arg.text === ',') {
1052
+ splice2(o, arg, arg.next);
1053
+ arg = arg.prev;
1054
+ }
1045
1055
  if (o.next && o.next.type === STAMP && o.next.text === '=>');
1046
1056
  else if (o.prev && o.prev.type === STRAP) {
1047
1057
  var p = o.prev;
@@ -1200,7 +1210,7 @@ var unforof = function (o, getnewname, used, killobj) {
1200
1210
  if (hasdeclare) {
1201
1211
  var [d] = getDeclared(m0);
1202
1212
  if (d.length) insert1(o, m, ...scanner2(d.join(",") + ","));
1203
- else splice(o, o.first, m0);
1213
+ else splice2(o, o.first, m0);
1204
1214
  }
1205
1215
  var iname = getnewname();
1206
1216
  var gname = getnewname();
@@ -1266,7 +1276,7 @@ var unarrow = function (body, i, killobj, letname_) {
1266
1276
  splice(b, 0, 0, { type: STRAP, transive: true, text: "return" }, ...splice(body, ni, nni - ni, b));
1267
1277
  killarg(h, b, letname_);
1268
1278
  killobj(b);
1269
- ni = nni;
1279
+ nni = indexof(body, b, ni) + 1;
1270
1280
  }
1271
1281
  else nni = ni + 1;
1272
1282
  return nni;
@@ -1614,7 +1624,7 @@ var newpunc = function (body, i, newname) {
1614
1624
  }
1615
1625
  splice(sentence, 0, 0, ...scanner2(`,${name}.${n}=${name}.${n}${punc}`));
1616
1626
  }
1617
- splice(sentence, 0, 0, ...scanner2(`${name}=`), ...splice(body, hi, i));
1627
+ splice(sentence, 0, 0, ...scanner2(`${name}=`), ...splice(body, hi, i - hi));
1618
1628
  if (!isEval(body) || hp && hp.type === STAMP && /[=>]$/.test(hp.text)) {
1619
1629
  var temp = scanner2(`()`)
1620
1630
  splice(temp[0], 0, 0, ...sentence);
@@ -258,7 +258,7 @@ function () {
258
258
  return [0, 9]
259
259
  },
260
260
  function () {
261
- _2 = _; if (!_2) return [1, 0]; _2 = !_["done"]; if (!_2) return [1, 0]; _2 = _0["return"]; _2 = isFunction(_2)
261
+ _2 = _; if (!_2) return [1, 0]; _2 = !_["done"]; if (!_2) return [1, 0]; _2 = _0["return"], _2 = typeof _2, _2 = _2 === "function"
262
262
  },
263
263
  function () {
264
264
  if (!_2) return [1, 0]; _2 = _0["return"](); return [1, 0]
@@ -287,10 +287,10 @@ function (_4) {
287
287
  _5 = _4; _1 = _5; _6 = Symbol["iterator"]; _6 = _1[_6]; if (_6) return [1, 0]; _6 = Array["prototype"]; _7 = Symbol["iterator"]; _6 = _6[_7]
288
288
  },
289
289
  function () {
290
- _2 = _6["call"](_1); _3 = undefined; _3 = _2["next"](); o = _3["value"]; _3 = _2["next"](); s = _3["value"]; _10 = !_3; if (_10) return [1, 0]; _10 = !_3["done"]
290
+ _2 = _6["call"](_1); _3 = undefined; _3 = _2["next"](); o = _3["value"]; _3 = _2["next"](); s = _3["value"]; _11 = !_3; if (_11) return [1, 0]; _11 = !_3["done"]
291
291
  },
292
292
  function () {
293
- if (!_10) return [1, 0]; _10 = _2["return"]; _10 = isFunction(_10); if (!_10) return [1, 0]; _10 = _2["return"]()
293
+ _10 = _11; if (!_10) return [1, 0]; _10 = _2["return"], _10 = typeof _10, _10 = _10 === "function"; if (!_10) return [1, 0]; _10 = _2["return"]()
294
294
  },
295
295
  function () {
296
296
  _3 = _10; _5 = true
@@ -305,7 +305,7 @@ function () {
305
305
  return [0, 9]
306
306
  },
307
307
  function () {
308
- _5 = _; if (!_5) return [1, 0]; _5 = !_["done"]; if (!_5) return [1, 0]; _5 = _0["return"]; _5 = isFunction(_5)
308
+ _5 = _; if (!_5) return [1, 0]; _5 = !_["done"]; if (!_5) return [1, 0]; _5 = _0["return"], _5 = typeof _5, _5 = _5 === "function"
309
309
  },
310
310
  function () {
311
311
  if (!_5) return [1, 0]; _5 = _0["return"](); return [1, 0]
@@ -313,14 +313,14 @@ if (!_5) return [1, 0]; _5 = _0["return"](); return [1, 0]
313
313
  function () {
314
314
  return [1, 9]
315
315
  })
316
- var o, s, _, _0, _1, _2, _3, _5, _6, _7, _8, _9, _10`);
316
+ var o, s, _, _0, _1, _2, _3, _5, _6, _7, _8, _9, _10, _11`);
317
317
  assert(downLevel(`for(o of os) noSymbol`), `for (_ = 0; _ < os["length"] && (o = os[_], true); _++) noSymbol\r\nvar _, _0`)
318
- assert(downLevel(`for(var o of os) Symbol`), `try { for (var o, _0 = os[Symbol["iterator"]] || Array["prototype"][Symbol["iterator"]], _0 = _0["call"](os), _ = _0["next"](); !_["done"] && (o = _["value"], true); _ = _0["next"]()) Symbol } finally { if (_ && !_["done"] && isFunction(_0["return"])) _0["return"]() }\r\nvar _, _0`)
319
- assert(downLevel(`for(var o of os) Symbol`), `try { for (var o, _0 = os[Symbol["iterator"]] || Array["prototype"][Symbol["iterator"]], _0 = _0["call"](os), _ = _0["next"](); !_["done"] && (o = _["value"], true); _ = _0["next"]()) Symbol } finally { if (_ && !_["done"] && isFunction(_0["return"])) _0["return"]() }\r\nvar _, _0`)
320
- assert(downLevel(`for(var o of o)Symbol`), `try { for (var o, _1 = o, _0 = _1[Symbol["iterator"]] || Array["prototype"][Symbol["iterator"]], _0 = _0["call"](_1), _ = _0["next"](); !_["done"] && (o = _["value"], true); _ = _0["next"]()) Symbol } finally { if (_ && !_["done"] && isFunction(_0["return"])) _0["return"]() }\r\nvar _, _0, _1`)
321
- assert(downLevel(`for(var [a] of os)Symbol`), `try { for (var a, _0 = os[Symbol["iterator"]] || Array["prototype"][Symbol["iterator"]], _0 = _0["call"](os), _ = _0["next"](); !_["done"] && (_1 = _["value"], _2 = (_1[Symbol["iterator"]] || Array["prototype"][Symbol["iterator"]])["call"](_1), _3 = undefined, _3 = _2["next"](), a = _3["value"], _3 = (!_3 || !_3["done"]) && isFunction(_2["return"]) && _2["return"](), true); _ = _0["next"]()) Symbol } finally { if (_ && !_["done"] && isFunction(_0["return"])) _0["return"]() }
318
+ assert(downLevel(`for(var o of os) Symbol`), `try { for (var o, _0 = os[Symbol["iterator"]] || Array["prototype"][Symbol["iterator"]], _0 = _0["call"](os), _ = _0["next"](); !_["done"] && (o = _["value"], true); _ = _0["next"]()) Symbol } finally { if (_ && !_["done"] && typeof _0["return"] === "function") _0["return"]() }\r\nvar _, _0`)
319
+ assert(downLevel(`for(var o of os) Symbol`), `try { for (var o, _0 = os[Symbol["iterator"]] || Array["prototype"][Symbol["iterator"]], _0 = _0["call"](os), _ = _0["next"](); !_["done"] && (o = _["value"], true); _ = _0["next"]()) Symbol } finally { if (_ && !_["done"] && typeof _0["return"] === "function") _0["return"]() }\r\nvar _, _0`)
320
+ assert(downLevel(`for(var o of o)Symbol`), `try { for (var o, _1 = o, _0 = _1[Symbol["iterator"]] || Array["prototype"][Symbol["iterator"]], _0 = _0["call"](_1), _ = _0["next"](); !_["done"] && (o = _["value"], true); _ = _0["next"]()) Symbol } finally { if (_ && !_["done"] && typeof _0["return"] === "function") _0["return"]() }\r\nvar _, _0, _1`)
321
+ assert(downLevel(`for(var [a] of os)Symbol`), `try { for (var a, _0 = os[Symbol["iterator"]] || Array["prototype"][Symbol["iterator"]], _0 = _0["call"](os), _ = _0["next"](); !_["done"] && (_1 = _["value"], _2 = (_1[Symbol["iterator"]] || Array["prototype"][Symbol["iterator"]])["call"](_1), _3 = undefined, _3 = _2["next"](), a = _3["value"], _3 = (!_3 || !_3["done"]) && typeof _2["return"] === "function" && _2["return"](), true); _ = _0["next"]()) Symbol } finally { if (_ && !_["done"] && typeof _0["return"] === "function") _0["return"]() }
322
322
  var _, _0, _1, _2, _3`)
323
- assert(downLevel(`for(var [a,b] of os)Symbol`), `try { for (var a, b, _0 = os[Symbol["iterator"]] || Array["prototype"][Symbol["iterator"]], _0 = _0["call"](os), _ = _0["next"](); !_["done"] && (_1 = _["value"], _2 = (_1[Symbol["iterator"]] || Array["prototype"][Symbol["iterator"]])["call"](_1), _3 = undefined, _3 = _2["next"](), a = _3["value"], _3 = _2["next"](), b = _3["value"], _3 = (!_3 || !_3["done"]) && isFunction(_2["return"]) && _2["return"](), true); _ = _0["next"]()) Symbol } finally { if (_ && !_["done"] && isFunction(_0["return"])) _0["return"]() }
323
+ assert(downLevel(`for(var [a,b] of os)Symbol`), `try { for (var a, b, _0 = os[Symbol["iterator"]] || Array["prototype"][Symbol["iterator"]], _0 = _0["call"](os), _ = _0["next"](); !_["done"] && (_1 = _["value"], _2 = (_1[Symbol["iterator"]] || Array["prototype"][Symbol["iterator"]])["call"](_1), _3 = undefined, _3 = _2["next"](), a = _3["value"], _3 = _2["next"](), b = _3["value"], _3 = (!_3 || !_3["done"]) && typeof _2["return"] === "function" && _2["return"](), true); _ = _0["next"]()) Symbol } finally { if (_ && !_["done"] && typeof _0["return"] === "function") _0["return"]() }
324
324
  var _, _0, _1, _2, _3`)
325
325
  assert(downLevel(`[...a]=a`), `var &slice = Array["prototype"]["slice"];\r\na = &slice["call"](a, 0)`)
326
326
  assert(downLevel(`[c,...a]=a`), `var &slice = Array["prototype"]["slice"];\r\nc = a[0], a = &slice["call"](a, 1)`)
@@ -368,7 +368,7 @@ function () {
368
368
  return [0, 9]
369
369
  },
370
370
  function () {
371
- _3 = _0; if (!_3) return [1, 0]; _3 = !_0["done"]; if (!_3) return [1, 0]; _3 = _1["return"]; _3 = isFunction(_3)
371
+ _3 = _0; if (!_3) return [1, 0]; _3 = !_0["done"]; if (!_3) return [1, 0]; _3 = _1["return"], _3 = typeof _3, _3 = _3 === "function"
372
372
  },
373
373
  function () {
374
374
  if (!_3) return [1, 0]; _3 = _1["return"](); return [1, 0]
@@ -398,7 +398,7 @@ function () {
398
398
  return [0, 9]
399
399
  },
400
400
  function () {
401
- _2 = _; if (!_2) return [1, 0]; _2 = !_["done"]; if (!_2) return [1, 0]; _2 = _0["return"]; _2 = isFunction(_2)
401
+ _2 = _; if (!_2) return [1, 0]; _2 = !_["done"]; if (!_2) return [1, 0]; _2 = _0["return"], _2 = typeof _2, _2 = _2 === "function"
402
402
  },
403
403
  function () {
404
404
  if (!_2) return [1, 0]; _2 = _0["return"](); return [1, 0]
@@ -487,12 +487,50 @@ var _, _0`)
487
487
  assert(downLevel(`[...{}[a]]=[1]`), `var &slice = Array["prototype"]["slice"];
488
488
  _ = [1], {}[a] = &slice["call"](_, 0)
489
489
  var _`)
490
- assert(downLevel(`,{...{}[a]}=[1]`), `_ = [1], {}[a] = &rest(_, [])
490
+ assert(downLevel(`,{...{}[a]}=[1]`), `, _ = [1], {}[a] = &rest(_, [])
491
491
  var _`)
492
492
  assert(downLevel(`var res=null,res2=1,{...{}[a]}=[1]`), `var res = null, res2 = 1, _ = [1], {}[a] = &rest(_, [])
493
493
  var _`);
494
494
  assert(downLevel(`var res=null,{...{}[a]}=[1]`), `var res = null, _ = [1], {}[a] = &rest(_, [])
495
495
  var _`)
496
- assert(downLevel(`,{b,...{}[a]}=[1]`), `_ = [1], b = _.b, {}[a] = &rest(_, ["b"])
496
+ assert(downLevel(`,{b,...{}[a]}=[1]`), `, _ = [1], b = _.b, {}[a] = &rest(_, ["b"])
497
497
  var _`)
498
498
  assert(downLevel(`var penddings = {}, circle = [], module_keys = [];`), `var penddings = {}, circle = [], module_keys = [];`)
499
+ assert(downLevel(`0,{a,b}=this`), '0, _ = this, a = _.a, b = _.b\r\nvar _')
500
+ assert(downLevel(`0,{a,b}=1`), '0, _ = 1, a = _.a, b = _.b\r\nvar _')
501
+ assert(downLevel(`0,{a,b}=true`), '0, _ = true, a = _.a, b = _.b\r\nvar _')
502
+ assert(downLevel(`0,{a,b}=eval`), '0, _ = eval, a = _.a, b = _.b\r\nvar _')
503
+ assert(downLevel(`0,{a,b}=a`), '0, _ = a, a = a.a, b = _.b\r\nvar _')
504
+ assert(downLevel(`0,{a,b}=[]`), '0, _ = [], a = _.a, b = _.b\r\nvar _')
505
+ assert(downLevel(`0,{a,b}=a.b`), '0, _ = a.b, a = _.a, b = _.b\r\nvar _')
506
+ assert(downLevel(`var [list = this] = arguments;`), `var list = (_ = arguments[0], _ !== undefined ? _ : this);
507
+ var _`)
508
+ assert(downLevel(`var [list = this] = arguments`), `var list = (_ = arguments[0], _ !== undefined ? _ : this)
509
+ var _`)
510
+ assert(downLevel(`var [list = this] = 0;`), `var list = (_ = 0[0], _ !== undefined ? _ : this);
511
+ var _`)
512
+ assert(downLevel(`a => a() + a(1), a => a`), `function (a) { return a() + a(1) }, function (a) { return a }`)
513
+ assert(downLevel(`a(a,)`), `a(a)`);
514
+ assert(downLevel(`class{a=[...presets.source]}`), `var &slice = Array["prototype"]["slice"];
515
+ function () { this.a = &slice["call"](presets.source) }`);
516
+ assert(downLevel(`class{a=a=>a}`), `function () { this.a = function (a) { return a } }`);
517
+ assert(downLevel(`class{ get a(){[...a]}}`), `var &slice = Array["prototype"]["slice"];
518
+ function () {};
519
+ Object["defineProperty"](cls0["prototype"], "a", (tmp = {}, tmp["get"] = function () { &slice["call"](a) }, tmp))
520
+ var tmp`);
521
+ assert(downLevel(`class{ get (){[...a]}}`), `var &slice = Array["prototype"]["slice"];
522
+ function () {}; cls0["prototype"].get = function () { &slice["call"](a) }`);
523
+ assert(downLevel(`class{ async get a(){[...a]}}`), `var &slice = Array["prototype"]["slice"];
524
+ function () {};
525
+ Object["defineProperty"](cls0["prototype"], "a", (tmp = {}, tmp["get"] = function () { &slice["call"](a) }, tmp))
526
+ var tmp`);
527
+ assert(downLevel(`a=class{ static a(){[...a]}}`), `var &slice = Array["prototype"]["slice"];
528
+ a = function (cls0) { cls0.a = function () { &slice["call"](a) }
529
+ return cls0 }(function () {})`);
530
+ assert(downLevel(`a=class{ static(){[...a]}}`), `var &slice = Array["prototype"]["slice"];
531
+ a = function (cls0) { cls0["prototype"].static = function () { &slice["call"](a) }
532
+ return cls0 }(function () {})`);
533
+ assert(downLevel(`a=class{ static{[...a]}}`), `var &slice = Array["prototype"]["slice"];
534
+ a = function (cls0) { (function () { &slice["call"](a) }())
535
+ return cls0 }(function () {})`);
536
+
@@ -1,5 +1,5 @@
1
1
  var { SCOPED, EXPRESS, replace } = require("./common");
2
-
2
+ var keep = false;
3
3
  var patchObject = function (code, objs) {
4
4
  var rest = [code];
5
5
  var m = null;
@@ -12,7 +12,7 @@ var patchObject = function (code, objs) {
12
12
  }
13
13
  if (c.type === EXPRESS) {
14
14
  if (m = /^#\\(\d+)$/.exec(c.text)) {
15
- var o = cloneNode(objs[+m[1]]);
15
+ var o = cloneNode(objs[+m[1]], keep);
16
16
  if (o instanceof Array) replace(c, ...o);
17
17
  else replace(c, o);
18
18
  }
@@ -32,4 +32,10 @@ function rescan(strs, ...args) {
32
32
  dist = scanner2(dist.join(''));
33
33
  patchObject(dist, args);
34
34
  return dist;
35
+ }
36
+ rescan.keep = function () {
37
+ keep = true;
38
+ var res = rescan.apply(this, arguments);
39
+ keep = false;
40
+ return res;
35
41
  }
@@ -134,13 +134,13 @@ var _withget = function (text) {
134
134
  if (index < 0) index = text.length;
135
135
  var name = text.slice(0, index);
136
136
  var prop = text.slice(index);
137
- return rescan`${patchMark + "wget"}(${`"${name}"`},[${_evals()}],${name})${prop}`;
137
+ return rescan.keep`${patchMark + "wget"}(${`"${name}"`},[${_evals()}],${name})${prop}`;
138
138
  };
139
139
  var _withset = function (text, tmpname, valname) {
140
140
  var index = text.indexOf(".");
141
141
  if (index < 0) index = text.length;
142
142
  var name = text.slice(0, index);
143
- return rescan`if(${tmpname}=${patchMark + "with"}(${`"${name}"`},[${_evals()}]))${tmpname}.${text}=${valname};else ${text}=${valname};`;
143
+ return rescan.keep`if(${tmpname}=${patchMark + "with"}(${`"${name}"`},[${_evals()}]))${tmpname}.${text}=${valname};else ${text}=${valname};`;
144
144
  };
145
145
  var _switch = function (body, cx, unblock, result, getname) {
146
146
  var o = body[cx];
@@ -324,7 +324,7 @@ var _while = function (body, cx, unblock, result) {
324
324
  o = o.next;
325
325
  while (cx < body.length && body[cx] !== o) cx++;
326
326
  var i = result.length;
327
- var b = rescan`if (${getCondition(o, unblock, true)}) return []`;
327
+ var b = rescan.keep`if (${getCondition(o, unblock, true)}) return []`;
328
328
  var be = b[b.length - 1];
329
329
  pushstep(result, b);
330
330
  var i2 = result.length - 1;
@@ -351,7 +351,7 @@ var pushstep = function (result, step) {
351
351
  }
352
352
  else if (q.await_) {
353
353
  if (!step.awaited) {
354
- step.unshift(...rescan`${q.name}=${ret_};`), relink(step);
354
+ step.unshift(...rescan.keep`${q.name}=${ret_};`), relink(step);
355
355
  step.awaited = true;
356
356
  }
357
357
  result.push(step);
@@ -435,7 +435,7 @@ var _do = function (body, cx, unblock, result) {
435
435
  o = o.next.next;
436
436
 
437
437
  if (label.continue) ifpatch(result), label.contat = result.length;
438
- var b = rescan`if (${getCondition(o, unblock)}) return [${i - result.length}, 0]`;
438
+ var b = rescan.keep`if (${getCondition(o, unblock)}) return [${i - result.length}, 0]`;
439
439
  pushstep(result, b);
440
440
  b[b.length - 1][0].text = String(i - result.length + 1);
441
441
  while (cx < body.length && body[cx] !== o) cx++;
@@ -464,7 +464,7 @@ var _return = function (r) {
464
464
  x = stepReturn(name, 2);
465
465
  }
466
466
  else if (e === THROW) {
467
- x = rescan`throw ${name}`;
467
+ x = rescan.keep`throw ${name}`;
468
468
  }
469
469
  else if (e === YIELD) {
470
470
  x = stepReturn(name, 3);
@@ -781,7 +781,7 @@ var ternary = function (body, getname, ret) {
781
781
  }
782
782
  pushstep(d, stepReturn(1, 0, d));
783
783
  pushstep(c, stepReturn(d.length + 1, 0, c));
784
- pushstep(explist, rescan`if (${getCondition(b, function (b) {
784
+ pushstep(explist, rescan.keep`if (${getCondition(b, function (b) {
785
785
  b = ternary(b, getnextname, true);
786
786
  for (var b of b) pushstep(explist, b);
787
787
  return b;
@@ -1323,10 +1323,10 @@ function toqueue(body, getname, ret = false, result = []) {
1323
1323
  var n = getCondition(o, unblock, !isbr);
1324
1324
  o = o.next;
1325
1325
  if (isbr) {
1326
- var c = rescan`if (${n})`;
1326
+ var c = rescan.keep`if (${n})`;
1327
1327
  }
1328
1328
  else {
1329
- var c = rescan`if (${n}) return [0, 0]`;
1329
+ var c = rescan.keep`if (${n}) return [0, 0]`;
1330
1330
  }
1331
1331
  var ce = c[3];
1332
1332
  pushstep(result, c);
@@ -28,6 +28,16 @@ Object.assign(encode62, {
28
28
  src,
29
29
  map,
30
30
  time_delta: parseInt("zzzzz", 36),
31
+ pack: 'efront-encode62s',
32
+ packdecode(string) {
33
+ return this.timedecode(string, this.pack);
34
+ },
35
+ packencode(string) {
36
+ return this.timeencode(string, this.pack);
37
+ },
38
+ packupdate(string) {
39
+ return this.timeupdate(string, this.pack);
40
+ },
31
41
  safeencode(string, sign, offset) {
32
42
  string = encodeURIComponent(string).replace(/\./g, '..').replace(/[\!'\(\)~]/g, a => escape(a)).replace(/%/g, '.');
33
43
  return this.encode62(string, sign, offset);
@@ -36,23 +46,43 @@ Object.assign(encode62, {
36
46
  string = this.decode62(string, sign, offset).replace(/\.\.?/g, a => a === '.' ? "%" : ".");
37
47
  return decodeURIComponent(string);
38
48
  },
39
- timedecode(string) {
49
+ timedecode(string, pack) {
40
50
  var { time_delta } = this;
41
51
  var time_rest = string.slice(string.length - time_delta.toString(36).length, string.length);
42
52
  var time_start = parseInt((new Date() - parseInt(time_rest, 36)) / time_delta) * time_delta;
43
53
  var time_stamp = time_start + parseInt(time_rest, 36);
44
- return this.safedecode(string.slice(0, string.length - time_delta.toString(36).length), time_stamp.toString(36));
54
+ string = string.slice(0, string.length - time_delta.toString(36).length);
55
+ if (pack) {
56
+ string = this.decode62(string, time_stamp.toString(36) + pack);
57
+ var sign = string.slice(string.length - 7, string.length);
58
+ sign = parseInt(sign, 36);
59
+ sign -= 0x600000000 + (time_stamp & 0xffffffff);
60
+ string = string.slice(0, string.length - 7);
61
+ string = decode62S(string);
62
+ if (crc.string(time_stamp.toString(36) + pack + string) !== sign) throw new Error('数据校验不通过!');
63
+ return string;
64
+ }
65
+ return this.safedecode(string, time_stamp.toString(36));
45
66
  },
46
- timeencode(string) {
67
+ timeencode(string, pack) {
47
68
  var { time_delta } = this;
48
69
  var time_free = time_delta / 6 | 0;
49
70
  var time_stamp = +new Date() - time_free;
50
71
  var time_rest = time_stamp % time_delta;
51
72
  var time_rest_str = time_rest.toString(36);
52
73
  var time_delta_str = time_delta.toString(36);
53
- return this.safeencode(string, time_stamp.toString(36)) + repeat("0", time_delta_str.length - time_rest_str.length) + time_rest_str;
74
+ if (pack) {
75
+ var sign = crc.string(time_stamp.toString(36) + pack + string);
76
+ sign += 0x600000000 + (time_stamp & 0xffffffff);
77
+ string = encode62S(string) + sign.toString(36);
78
+ string = this.encode62(string, time_stamp.toString(36) + pack);
79
+ }
80
+ else {
81
+ string = this.safeencode(string, time_stamp.toString(36));
82
+ }
83
+ return string + repeat("0", time_delta_str.length - time_rest_str.length) + time_rest_str;
54
84
  },
55
- timeupdate(string) {
85
+ timeupdate(string, pack) {
56
86
  var { time_delta } = this;
57
87
  var time_rest = string.slice(string.length - time_delta.toString(36).length, string.length);
58
88
  var time_start = parseInt((new Date() - parseInt(time_rest, 36)) / time_delta) * time_delta;
@@ -60,7 +90,7 @@ Object.assign(encode62, {
60
90
  if (time_stamp + (time_delta >> 1) > +new Date()) {
61
91
  return string;
62
92
  } else {
63
- return this.timeencode(this.timedecode(string));
93
+ return this.timeencode(this.timedecode(string, pack), pack);
64
94
  }
65
95
  },
66
96
  encode62(data, sign, offset = 0) {
@@ -1,51 +1,11 @@
1
1
  "use strict";
2
2
  // 中文编码 utf-8
3
- describe("encode62_test", function () {
4
- var encode62, a, b, c, d;
5
- var expect = require("chai").expect;
6
- var timeencoded;
7
- before(function () {
8
- encode62 = require("./encode62");
9
- });
10
- it("encode62", function () {
11
- console.log(encode62("你好啊"));
12
- });
13
- it("encode62.timeencode", function () {
14
- console.log(timeencoded = encode62.timeencode("xiao"));
15
- });
16
- it("encode62.timedecode", function () {
17
- console.log(encode62.timedecode(timeencoded));
18
- });
19
- it("encode62.encode", function () {
20
- console.log(timeencoded = encode62.encode("adfasd", 'abcd'));
21
- });
22
- it("encode62.decode", function () {
23
- console.log(encode62.decode(timeencoded, 'abcd').toString());
24
- });
25
- it("geta", function () {
26
- a = encode62.geta("efront");
27
- });
28
- it("genb", function () {
29
- b = encode62.genb();
30
- });
31
- it("ab2c", function () {
32
- c = encode62.ab2c(a, b);
33
- });
34
- it("ba2d", function () {
35
- // 注意,参数顺序已变更
36
- d = encode62.ba2d(b, a);
37
- });
38
- it("ca2b", function () {
39
- expect(encode62.ca2b(c, a)).to.be.eq(b);
40
- });
41
- it("cb2a", function () {
42
- expect(encode62.cb2a(c, b)).to.be.eq(a);
43
- });
44
- it("da2b", function () {
45
- expect(encode62.da2b(d, a)).to.be.eq(b);
46
- });
47
- it("db2a", function () {
48
- expect(encode62.db2a(d, b)).to.be.eq(a);
49
- })
3
+ var test = function (string) {
4
+ var packed = encode62.packencode(string);
5
+ var unpacked = encode62.packdecode(packed);
6
+ assert(string, unpacked);
7
+ }
50
8
 
51
- });
9
+ test('adsfa');
10
+ test('a');
11
+ test('');
@@ -59,11 +59,7 @@ fileitem {
59
59
  outline: 1.2px solid #28c;
60
60
  }
61
61
 
62
- &:active {
63
- color: #28c;
64
- outline: 2px solid;
65
- }
66
-
62
+
67
63
  &.focused {
68
64
  background: #28c2;
69
65
  outline: 1.2px solid #28c;
@@ -136,7 +136,7 @@ function chat(title = '会话窗口') {
136
136
  break;
137
137
  }
138
138
  return false;
139
- }).map(m => JSAM.parse(encode62.timedecode(m))).filter(m => {
139
+ }).map(m => JSAM.parse(encode62.packdecode(m))).filter(m => {
140
140
  if (m.type === 'accept') {
141
141
  page.$scope.pushFile(m.content);
142
142
  return false;
@@ -266,7 +266,7 @@ function chat(title = '会话窗口') {
266
266
  if (this.user && this.user.id !== this.localid && type !== "accept") {
267
267
  addToMsgList(this.msglist, [msg]);
268
268
  }
269
- data = encode62.timeencode(data);
269
+ data = encode62.packencode(data);
270
270
  cast(page, "send", data);
271
271
  this.body.lastElementChild.focus();
272
272
  this.text = '';
@@ -1,13 +1,14 @@
1
- <header ng-if="!user.isLogin" class="navbar-header">
1
+ <header head ng-if="!user.isLogin" class="navbar-header">
2
2
  <!-- <avatar></avatar> -->
3
3
  <a @click="popup('#/user/login')" class="dashboard_text">请登录</a>
4
4
  </header>
5
- <header -else class="navbar-header">
5
+ <header head -else class="navbar-header">
6
6
  <span class="dashboard_text" @click="go('/user/profile')">
7
7
  <avatar ng-src="user.avatar" size=30></avatar>
8
8
  <span ng-bind="user.name"></span>
9
9
  <span ng-bind="user.roles"></span>
10
10
  </span>
11
11
  </header>
12
- <ylist mode=inline ng-src="menu in menus" class="sidebar-menu" ng-active="menus.open(menu)">
13
- </ylist>
12
+ <ylist body mode=inline ng-src="menu in menus" class="sidebar-menu" ng-active="menus.open(menu)">
13
+ </ylist>
14
+ <footer foot></footer>
@@ -17,5 +17,6 @@ function main() {
17
17
  on('append')(page, function () {
18
18
  frame$route.open();
19
19
  });
20
+ view(page)
20
21
  return page;
21
22
  }
@@ -1,16 +1,18 @@
1
1
  & {
2
- padding: 50px 0 0 0;
2
+ padding: 0 0 0 0;
3
3
  position: relative;
4
4
  }
5
5
 
6
6
  .navbar-header {
7
+ &:before{
8
+ display: none;
9
+ }
7
10
  min-height: 50px;
8
11
  padding: 10px 15px 10px 25px;
9
12
  font-size: 25px;
10
13
  line-height: 25px;
11
14
  text-transform: uppercase;
12
15
  color: #b8c7ce;
13
- margin-top: -50px;
14
16
  display: block;
15
17
  }
16
18
 
@@ -32,7 +34,7 @@ ylist {
32
34
  box-shadow: none;
33
35
  }
34
36
 
35
- .label {
37
+ >.header .label {
36
38
  border-radius: 4px;
37
39
  height: 18px;
38
40
  line-height: 18px;
@@ -22,7 +22,7 @@ function main(paytypes, price, subject = '网站扫码支付') {
22
22
  if (!pay) return 'about:blank';
23
23
  var url = pay.url;
24
24
  if (isFunction(url)) url = url.call(pay, this.finalpay, subject);
25
- else if (url) url += encode62.timeencode(this.finalpay + "," + subject);
25
+ else if (url) url += encode62.packencode(this.finalpay + "," + subject);
26
26
  return url;
27
27
  },
28
28
  get finalpay() {
@@ -50,7 +50,7 @@ function main(paytypes, price, subject = '网站扫码支付') {
50
50
  var query = lazy(async function () {
51
51
  if (!tradeid || queryres) return;
52
52
  if (isFunction(queryurl)) var res = await queryurl(tradeid);
53
- else if (isString(queryurl)) var res = await cross('get', queryurl + encode62.timeencode(tradeid)), res = JSAM.parse(res.response || res.responseText);
53
+ else if (isString(queryurl)) var res = await cross('get', queryurl + encode62.packencode(tradeid)), res = JSAM.parse(res.response || res.responseText);
54
54
  if (queryres) return;
55
55
  if (res) queryres = res, cast(page, 'payment', res._id);
56
56
  }, -200);
@@ -253,12 +253,15 @@ var acme2 = new class {
253
253
  var termsOfService = data?.meta?.termsOfService;
254
254
  return termsOfService;
255
255
  }
256
- async newAccount(params) {
256
+ getAccount(params) {
257
+ return this.newAccount(params, true);
258
+ }
259
+ async newAccount(params, onlyReturnExisting) {
257
260
  var account = await request("new-account", {
258
261
  "contact": [
259
262
  "mailto:" + params.email
260
263
  ],
261
- // onlyReturnExisting: false,// 可选
264
+ onlyReturnExisting: onlyReturnExisting,// 可选
262
265
  // externalAccountBinding: {},// 可选
263
266
  "termsOfServiceAgreed": params.termsOfServiceAgreed
264
267
  });
@@ -267,7 +270,7 @@ var acme2 = new class {
267
270
  this.kid = account;
268
271
  var a = data.getUrlParamsForApi(accountApi, account);
269
272
  this.aid = a.aid;
270
- alert('创建成功!', 'success');
273
+ alert(onlyReturnExisting ? "账号存在" : '创建成功!', 'success');
271
274
  return account;
272
275
  }
273
276
  async newOrder(params) {
@@ -366,7 +369,7 @@ var acme2 = new class {
366
369
  o = await acme2.auditOrder(o, setauth);
367
370
  }
368
371
  if (o.status === 'ready') {
369
- await this.finalizeOrder(o, upload);
372
+ o = await this.finalizeOrder(o, upload);
370
373
  o = await this.waitStatus(o);
371
374
  }
372
375
  if (o.status === 'valid') {
@@ -0,0 +1,25 @@
1
+ <style>
2
+ & {
3
+ position: absolute;
4
+ width: 100%;
5
+ bottom: 0;
6
+ left: 0;
7
+ right: 0;
8
+ z-index: 1;
9
+ display: block;
10
+ text-align: center;
11
+ }
12
+ </style>
13
+ <div>
14
+ <a @click="logout">${i18n`退出登录`}</a>
15
+ </div>
16
+
17
+ <script>
18
+ var a = button;
19
+ async function logout() {
20
+ data.setSource({});
21
+ await user.Logout();
22
+ zimoli.switch();
23
+ zimoli();
24
+ }
25
+ </script>