efront 4.4.11 → 4.4.13

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 (72) hide show
  1. package/#/345/233/275/351/231/205/345/214/226.yml +884 -65
  2. package/apps/reptile/encode.js +1 -1
  3. package/coms/basic/#loader.js +4 -4
  4. package/coms/basic/BigNumber.js +6 -6
  5. package/coms/basic/BitTree.js +1 -1
  6. package/coms/basic/Enum.js +1 -1
  7. package/coms/basic/Matrix.js +1 -1
  8. package/coms/basic/analyse_test.js +1 -1
  9. package/coms/basic/assert.js +1 -1
  10. package/coms/basic/color.js +1 -1
  11. package/coms/basic/compile.js +1 -1
  12. package/coms/basic/cross_.js +2 -2
  13. package/coms/basic/crypt.js +3 -3
  14. package/coms/basic/decodePack.js +3 -3
  15. package/coms/basic/deepEqual.js +1 -1
  16. package/coms/basic/encodeRange_test.js +1 -1
  17. package/coms/basic/encodeUTF16.js +2 -2
  18. package/coms/basic/encodeUTF8.js +1 -1
  19. package/coms/basic/parseYML.js +2 -2
  20. package/coms/basic/refilm.js +2 -2
  21. package/coms/basic/repeat.js +1 -1
  22. package/coms/basic/submit_.js +4 -4
  23. package/coms/basic_/Array2.js +2 -2
  24. package/coms/basic_/Promise.js +1 -1
  25. package/coms/basic_/exec_.js +1 -1
  26. package/coms/compile/Javascript.js +2 -2
  27. package/coms/compile/Program.js +1 -1
  28. package/coms/compile/common.js +5 -5
  29. package/coms/compile/downLevel.js +5 -5
  30. package/coms/compile/unstruct.js +9 -4
  31. package/coms/compile/unstruct_test.js +2 -1
  32. package/coms/compile/washcode.js +2 -2
  33. package/coms/docs/execute.js +1 -1
  34. package/coms/explorer/Explorer.js +6 -6
  35. package/coms/explorer/context.js +16 -16
  36. package/coms/explorer/deepcp.js +2 -2
  37. package/coms/explorer/edit.html +3 -3
  38. package/coms/frame/chat.html +2 -2
  39. package/coms/frame/route.js +1 -1
  40. package/coms/kugou/parseSongsList.js +1 -1
  41. package/coms/reptile/colored_console.js +8 -2
  42. package/coms/reptile/cross.js +1 -1
  43. package/coms/reptile/decodeHttpResponse.js +1 -1
  44. package/coms/reptile/detectWithExtension.js +1 -1
  45. package/coms/zimoli/Enum.js +1 -1
  46. package/coms/zimoli/api.js +19 -19
  47. package/coms/zimoli/avatarEditor.js +1 -1
  48. package/coms/zimoli/care.js +3 -3
  49. package/coms/zimoli/cast.js +1 -1
  50. package/coms/zimoli/chooseFile.js +2 -2
  51. package/coms/zimoli/clock.js +1 -1
  52. package/coms/zimoli/confirm.js +2 -2
  53. package/coms/zimoli/createElement.js +2 -2
  54. package/coms/zimoli/cross.js +3 -3
  55. package/coms/zimoli/css.js +1 -1
  56. package/coms/zimoli/downloadmap.js +2 -2
  57. package/coms/zimoli/grid.js +4 -4
  58. package/coms/zimoli/icon.js +1 -1
  59. package/coms/zimoli/list.js +1 -1
  60. package/coms/zimoli/mediaDevices.js +1 -1
  61. package/coms/zimoli/menu.js +1 -1
  62. package/coms/zimoli/on.js +3 -3
  63. package/coms/zimoli/overlap_test.js +1 -1
  64. package/coms/zimoli/popup.js +2 -2
  65. package/coms/zimoli/render.js +10 -10
  66. package/coms/zimoli/table.js +1 -1
  67. package/coms/zimoli/watch.js +1 -1
  68. package/coms/zimoli/zimoli.js +3 -3
  69. package/docs//345/267/245/345/205/267//345/233/275/351/231/205/345/214/226.xht +12 -4
  70. package/package.json +1 -1
  71. package/public/efront.js +1 -729
  72. package/coms/kugou/fxPlayer.js +0 -12474
@@ -31,7 +31,7 @@ var crypt = function (error, files) {
31
31
  }, files);
32
32
  };
33
33
  if (!code) {
34
- throw new Error("请设置密码");
34
+ throw new Error(i18n`请设置密码`);
35
35
  }
36
36
  crypt(null, [
37
37
  'photos/05.jpg'
@@ -670,16 +670,16 @@ var initPixelDecoder = function () {
670
670
  if (pixelDecoder instanceof Function) {
671
671
  modules.fromPixel = pixelDecoder;
672
672
  modules.freePixel = window.freePixel || function () {
673
- throw new Error("您在window上实现了pixelDecoder,请手动实现相应的freePixel!");
673
+ throw new Error(`您在window上实现了pixelDecoder,请手动实现相应的freePixel!`);
674
674
  };
675
675
  modules.calcPixel = window.calcPixel || function () {
676
- throw new Error("您在window上实现了pixelDecoder,请手动实现相应的calcPixel!");
676
+ throw new Error(`您在window上实现了pixelDecoder,请手动实现相应的calcPixel!`);
677
677
  };
678
678
  modules.fromOffset = window.fromOffset || function () {
679
- throw new Error("您在window上实现了pixelDecoder,请手动实现相应的fromOffset!");
679
+ throw new Error(`您在window上实现了pixelDecoder,请手动实现相应的fromOffset!`);
680
680
  };
681
681
  modules.freeOffset = window.freeOffset || function () {
682
- throw new Error("您在window上实现了pixelDecoder,请手动实现相应的freeOffset!");
682
+ throw new Error(`您在window上实现了pixelDecoder,请手动实现相应的freeOffset!`);
683
683
  };
684
684
  return;
685
685
  }
@@ -111,8 +111,8 @@ class BigNumber {
111
111
  if (!system_scale) {
112
112
  system_scale = 10;
113
113
  }
114
- if (system_scale === 1) throw new Error("不支持半年级数数进制!");
115
- if (system_scale < 1) throw new Error("不支持小于1的进位方针!");
114
+ if (system_scale === 1) throw new Error(i18n`不支持半年级数数进制!`);
115
+ if (system_scale < 1) throw new Error(i18n`不支持小于1的进位方针!`);
116
116
  var BACK_DIGIT = BigNumber.DECIMAL_DIGIT;
117
117
  var digit = value.indexOf('.');
118
118
  if (digit < 0) digit = 0;
@@ -153,7 +153,7 @@ class BigNumber {
153
153
  v = +v;
154
154
  }
155
155
  else v = vmap[v];
156
- if (v !== v || v >= system_scale || v !== +v) throw new Error("数据错误!");
156
+ if (v !== v || v >= system_scale || v !== +v) throw new Error(i18n`数据错误!`);
157
157
 
158
158
  if (dotOccurs) {
159
159
  num = BigNumber.add(num, BigNumber.div(v, scale, BigNumber.DECIMAL_DIGIT))
@@ -178,7 +178,7 @@ class BigNumber {
178
178
  if (收起零) 有效数字位数 = -有效数字位数;
179
179
  var zero = system_scale <= 36 ? '0' : '[0]';
180
180
  if (!system_scale || system_scale === 10) return this.value || zero;
181
- if (system_scale <= 1) throw new Error("进制错误!");
181
+ if (system_scale <= 1) throw new Error(i18n`进制错误!`);
182
182
  var BACK_DIGIT = BigNumber.DECIMAL_DIGIT;
183
183
  if (!有效数字位数) 有效数字位数 = Math.ceil((this.digit || BigNumber.DECIMAL_DIGIT) / Math.log10(system_scale));
184
184
  BigNumber.DECIMAL_DIGIT = 有效数字位数 + 10 + system_scale;
@@ -262,7 +262,7 @@ class BigNumber {
262
262
  static fix(numstr, fractionDigits) {
263
263
  fractionDigits = +fractionDigits || 0;
264
264
  if (fractionDigits < 0 || fractionDigits > BigNumber.DECIMAL_DIGIT) {
265
- throw new Error(`小数位数只能是0和${BigNumber.DECIMAL_DIGIT}之间的数字`);
265
+ throw new Error(i18n`小数位数只能是0和${BigNumber.DECIMAL_DIGIT}之间的数字`);
266
266
  }
267
267
  return fixde(numstr, fractionDigits, 4);
268
268
  }
@@ -373,7 +373,7 @@ class BigNumber {
373
373
  }
374
374
  // 按整数除法,超出输入的数字的位数之和
375
375
  static div(numstr1, numstr2, decimal) {
376
- if (isEmpty(decimal)) throw new Error("请输入保留小数的位数!");
376
+ if (isEmpty(decimal)) throw new Error(i18n`请输入保留小数的位数!`);
377
377
  var [neg1, s11, s12] = prepare(numstr1);
378
378
  var [neg2, s21, s22] = prepare(numstr2);
379
379
  var d = s12.length + decimal - s22.length;
@@ -11,7 +11,7 @@ class BitTree extends Array {
11
11
  if (a === undefined) a = 1;
12
12
  for (var cx = 0, dx = arr.length; cx < dx; cx++)arr[cx] = a;
13
13
  }
14
- if (!arr || !arr.length) throw new Error("参数错误!");
14
+ if (!arr || !arr.length) throw new Error(i18n`参数错误!`);
15
15
  this.counts = arr;
16
16
  this.rebuild();
17
17
  }
@@ -12,7 +12,7 @@ EnumItem.prototype = {
12
12
  }
13
13
  }
14
14
  function Enum() {
15
- if (!this) throw new Error("请用new关键字创建!");
15
+ if (!this) throw new Error(i18n`请用new关键字创建!`);
16
16
  return new Proxy({ 0: 0 }, {
17
17
  get(o, k) {
18
18
  if (isFinite(k)) {
@@ -390,7 +390,7 @@ function cross(vec1, vec2) {
390
390
  if (vec1.length !== vec2.length) throw notMatchLength;
391
391
  if (vec1.length === 2) return cross2(vec1, vec2);
392
392
  if (vec1.length === 3) return cross3(vec1, vec2);
393
- throw new Error("向量维度不支持!");
393
+ throw new Error(i18n`向量维度不支持!`);
394
394
  }
395
395
  function 负(a) {
396
396
  return -a;
@@ -36,7 +36,7 @@ function testcode(dir) {
36
36
  });
37
37
  }
38
38
  function analyse_test(text) {
39
- if (!require) return console.log("请在electron中打开");
39
+ if (!require) return console.log(i18n`请在electron中打开`);
40
40
  fs = require("fs");
41
41
  path = require("path");
42
42
  if (text) return analyse(text);
@@ -10,7 +10,7 @@ else {
10
10
  var crack = [, ,];
11
11
  }
12
12
  var dump = function (a, msg) {
13
- if (a instanceof Object) console.error('属性错误'), console.log(msg ? msg + " " : " {\r\n", Object.keys(a).map(k => ` ${k}${gray.join(':')}\r\n ${a[k]}`).join('\r\n') + "\r\n }");
13
+ if (a instanceof Object) console.error(i18n`属性错误`), console.log(msg ? msg + " " : " {\r\n", Object.keys(a).map(k => ` ${k}${gray.join(':')}\r\n ${a[k]}`).join('\r\n') + "\r\n }");
14
14
  else if (msg) console.log(msg + ":", a);
15
15
  else console.log(a);
16
16
  };
@@ -263,7 +263,7 @@ function doWith(manager, color, ...args) {
263
263
  var isparsed = color instanceof Array,
264
264
  c = isparsed ? color : parse(color);
265
265
  if (!c) {
266
- console.warn(`颜色数据不正确:${color}`);
266
+ console.warn(i18n`颜色数据不正确:${color}`);
267
267
  return color;
268
268
  }
269
269
  c = manager(c, ...args);
@@ -48,7 +48,7 @@ Scanner.prototype = {
48
48
  }
49
49
  block.end = index;
50
50
  } else if (/y/.test(reg.flags)) {
51
- throw new Error(`unexcepted token ${dataString[index]}`);
51
+ throw new Error(i18n`意外标记 ${dataString[index]}`);
52
52
  } else {
53
53
  index = dataString.length;
54
54
  }
@@ -128,7 +128,7 @@ function createResponse(response, status = 0) {
128
128
  */
129
129
  function cross_(jsonp, digest = noop, method, url, headers) {
130
130
  var originDomain = getDomainPath(url);
131
- if (!originDomain) throw new Error("路径格式错误!");
131
+ if (!originDomain) throw new Error(i18n`路径格式错误!`);
132
132
  var loaded, errored;
133
133
  var onload = function (data) {
134
134
  if (!~requests.indexOf(_xhr)) return;
@@ -217,7 +217,7 @@ function cross_(jsonp, digest = noop, method, url, headers) {
217
217
 
218
218
  }
219
219
  if (exposeMap["strict-transport-security"] || exposeMap["efront-transport-security"]) {
220
- if (!/^https\:\/\/|^s\/\//.test(url)) console.warn("请使用https访问如下路径:" + url);
220
+ if (!/^https\:\/\/|^s\/\//.test(url)) console.warn(i18n`请使用https访问如下路径:` + url);
221
221
  }
222
222
  }
223
223
  if (isencrypt && xhr.response) {
@@ -23,7 +23,7 @@ var encrypt = function (data, mask) {
23
23
  };
24
24
  var stringify = function (data, password) {
25
25
  if (!password || password.length < 2) {
26
- throw new Error("请传入更高强度的密码!");
26
+ throw new Error(i18n`请传入更高强度的密码!`);
27
27
  }
28
28
  data = JSAM.stringify(data);
29
29
  var code = calc("password", password) + password;
@@ -33,11 +33,11 @@ var stringify = function (data, password) {
33
33
  };
34
34
  var parse = function (data, password) {
35
35
  var d = data.lastIndexOf('/');
36
- if (d < 0) throw new Error("数据异常!");
36
+ if (d < 0) throw new Error(i18n`数据异常!`);
37
37
  var sign = data.slice(d);
38
38
  data = data.slice(0, d);
39
39
  var sign0 = calc(data, password);
40
- if (sign !== sign0) throw new Error("密码不正确!");
40
+ if (sign !== sign0) throw new Error(i18n`密码不正确!`);
41
41
  var code = calc("password", password) + password;
42
42
  data = encrypt(data, code);
43
43
  return data;
@@ -77,7 +77,7 @@ function fromhuff(buff, result = [], scanstart, type) {
77
77
  "\r\nbitwidth:", t,
78
78
  "\r\ncodemap:", map
79
79
  );
80
- throw console.warn("数据异常!");
80
+ throw console.warn(i18n`数据异常!`);
81
81
  }
82
82
  bitoffset = bitoffset + endflag[1];
83
83
  return bitoffset;
@@ -190,11 +190,11 @@ function unpack(buff) {
190
190
  result.push(res);
191
191
  break;
192
192
  default:
193
- throw new Error("编码异常!");
193
+ throw new Error(i18n`编码异常!`);
194
194
  }
195
195
  break;
196
196
  default:
197
- throw new Error("数据异常!");
197
+ throw new Error(i18n`数据异常!`);
198
198
  }
199
199
  } while (byteoffset + 1 < buff.length);
200
200
  result = concatByte(result);
@@ -8,7 +8,7 @@ var checkMemery = function (msg) {
8
8
  if (count > inc) {
9
9
  inc = (count / ALLOW_CACHE_LENGTH + 1 | 0) * ALLOW_CACHE_LENGTH;
10
10
  if (inc >= ALLOW_REST_DEPTH * ALLOW_CACHE_LENGTH) {
11
- console.warn("对象过大,deepEqual未能完成比对");
11
+ console.warn(i18n`对象过大,${"deepEqual"}未能完成比对`);
12
12
  return false;
13
13
  }
14
14
  console.warn(msg);
@@ -19,7 +19,7 @@ function test(size) {
19
19
  ecx: encoded[cx],
20
20
  dcx: decoded[cx],
21
21
  })
22
- throw new Error("解码异常!");
22
+ throw new Error(i18n`解码异常!`);
23
23
  }
24
24
  }
25
25
  console.log({
@@ -1,6 +1,6 @@
1
1
  function numberUTF16(t, dist = []) {
2
2
  if (t > 0x10ffff) {
3
- throw new Error("编码错误");
3
+ throw new Error(i18n`编码错误`);
4
4
  }
5
5
  if (t <= 0xffff) {
6
6
  dist.push(t >> 8, t & 0xff);
@@ -13,7 +13,7 @@ function numberUTF16(t, dist = []) {
13
13
  }
14
14
  function numberUTF16LE(t, dist = []) {
15
15
  if (t > 0x10ffff) {
16
- throw new Error("编码错误");
16
+ throw new Error(i18n`编码错误`);
17
17
  }
18
18
  if (t <= 0xffff) {
19
19
  dist.push(t & 0xff, t >> 8);
@@ -40,7 +40,7 @@ function numberUTF8(t, dist = []) {
40
40
  }
41
41
  }
42
42
  else {
43
- throw new Error("数据异常");
43
+ throw new Error(i18n`数据异常`);
44
44
  }
45
45
  return dist;
46
46
  }
@@ -169,13 +169,13 @@ var scan = function (text) {
169
169
  push();
170
170
  break;
171
171
  case "]":
172
- if (jsonlikes[jsonlikes.length - 1] !== "[") console.warn('数据存在错误!', jsonlikes, pre);
172
+ if (jsonlikes[jsonlikes.length - 1] !== "[") console.warn(i18n`数据存在错误!`, jsonlikes, pre);
173
173
  if (data) push();
174
174
  jsonlikes.pop();
175
175
  parents.pop();
176
176
  break;
177
177
  case "}":
178
- if (jsonlikes[jsonlikes.length - 1] !== "{") console.warn("数据存在错误!", jsonlikes, pre);
178
+ if (jsonlikes[jsonlikes.length - 1] !== "{") console.warn(i18n`数据存在错误!`, jsonlikes, pre);
179
179
  if (prop !== undefined || data) push();
180
180
  jsonlikes.pop();
181
181
  parents.pop();
@@ -36,12 +36,12 @@ var writeField = refilm.writeField = function (data, field, value, offset = fiel
36
36
  v.push(value & 0xff);
37
37
  value = value >>> 8;
38
38
  }
39
- if (value) throw new Error("数据过大");
39
+ if (value) throw new Error(i18n`数据过大`);
40
40
  value = v;
41
41
  }
42
42
  else value = [value | 0];
43
43
  if (value.length > byteLimit) {
44
- throw new Error("数据超出大小限制!");
44
+ throw new Error(i18n`数据超出大小限制!`);
45
45
  }
46
46
  var offset = field.offset;
47
47
  while (value.length) data[offset++] = value.shift();
@@ -4,7 +4,7 @@ function repeat(string, time) {
4
4
  time = +time | 0;
5
5
  if (time <= 0) return "";
6
6
  if (+time * string.length > 0x1ffffff) {
7
- throw new Error("占用内存过大!");
7
+ throw new Error(i18n`占用内存过大!`);
8
8
  }
9
9
  var result = [];
10
10
  while (--time >= 0) {
@@ -49,15 +49,15 @@ function submit(fields, data) {
49
49
  }
50
50
  if (checks.length + select.length + inputs.length) {
51
51
  var errors = [];
52
- if (inputs.length) errors.push("请输入" + inputs.map(trimname).join("、"));
53
- if (select.length) errors.push("请选择" + select.map(trimname).join("、"));
52
+ if (inputs.length) errors.push(i18n`请输入` + inputs.map(trimname).join(i18n`、`));
53
+ if (select.length) errors.push(i18n`请选择` + select.map(trimname).join(i18n`、`));
54
54
  if (select.id < inputs.id) {
55
55
  errors = errors.reverse();
56
56
  }
57
57
  if (checks.length) {
58
- errors.push("您输入的" + checks.map(trimname).join("、") + "有误");
58
+ errors.push(i18n`您输入的${checks.map(trimname).join(i18n`、`)}有误`);
59
59
  }
60
- errors = errors.join(",") + "!";
60
+ errors = errors.join(i18n`,`) + i18n`!`;
61
61
  throw errors;
62
62
  }
63
63
  return params;
@@ -5,7 +5,7 @@ a: if (!setPrototypeOf) {
5
5
  var getOwnPropertyNames = Object.getOwnPropertyNames;
6
6
  var defineProperty = Object.defineProperty;
7
7
  try {
8
- if (!getOwnPropertyNames) throw '不支持';
8
+ if (!getOwnPropertyNames) throw i18n`不支持`;
9
9
  defineProperty({}, 'o', { value: 0 });
10
10
  setPrototypeOf = function (obj, proto) {
11
11
  var names = getOwnPropertyNames(proto)
@@ -22,7 +22,7 @@ a: if (!setPrototypeOf) {
22
22
  getOwnPropertyNames = null;
23
23
  }
24
24
  // <!--
25
- console.error('当前运行环境使用class extends Array会有难以解决的不兼容性问题,请更换代码的实现方式!');
25
+ console.error(i18n`当前运行环境使用class extends Array会有难以解决的不兼容性问题,请更换代码的实现方式!`);
26
26
  // -->
27
27
  setPrototypeOf = function (obj, proto) {
28
28
  for (var p in proto) if (hasOwnProperty.call(proto, p) && !(p in obj)) obj[p] = proto[p];
@@ -33,7 +33,7 @@ if (!Promise) {
33
33
  t.throwed = true;
34
34
  if (!throwed && !PromiseRejectReactions.length) {
35
35
  // <!--
36
- console.warn("在异步过程中发现未处理的异常:", t.ohed[0], t.ohed[1], t.ohed[2]);
36
+ console.warn(i18n`在异步过程中发现未处理的异常:`, t.ohed[0], t.ohed[1], t.ohed[2]);
37
37
  // -->
38
38
  requestAnimationFrame(function () {
39
39
  throw t.ohed[0];
@@ -82,7 +82,7 @@ var exec_ = function (args, ok, oh, int) {
82
82
  case 7: index++; catches.push([index, p]); break; // try catch finally?
83
83
  case 8: index++; catches.push([index, p, 1]); break; // try finally
84
84
  case 9: return p ? fine() : fina(); // finally
85
- default: throw console.log(a), "代码异常!";
85
+ default: throw console.log(a), i18n`代码异常!`;
86
86
  }
87
87
  }
88
88
  retn();
@@ -478,7 +478,7 @@ var collectProperty = function (o, text) {
478
478
  while (n && (n.type !== STAMP || n.text !== ',')) n = n.next;
479
479
  var end = n ? q.indexOf(n, start) + 1 : q.length;
480
480
  var s = splice(q, start, end - start);
481
- if (s.length) console.info(`属性<green>${text}</green>被后文覆盖,已移除<yellow>${createString(s)}</yellow>\r\n`);
481
+ if (s.length) console.info(i18n`属性<green>${text}</green>被后文覆盖,已移除<yellow>${createString(s)}</yellow>\r\n`);
482
482
  if (p && n) {
483
483
  var pp = p.prev;
484
484
  n.prev = pp;
@@ -829,7 +829,7 @@ var removeExport = function (c, i, code) {
829
829
  return;
830
830
  }
831
831
  var nn = n.next;
832
- if (!nn) throw new Error('缺少导出项!');
832
+ if (!nn) throw new Error(i18n`缺少导出项!`);
833
833
  if (nn.type === SCOPED && nn.entry !== '{' && c.prev) {
834
834
  if (c.prev.type !== STAMP || c.prev.text !== ';') {
835
835
  code.splice(i++, 0, { type: STAMP, text: ';' });
@@ -670,7 +670,7 @@ class Program {
670
670
  if (q.length > 2) {
671
671
  ts.push(...q.slice(0, q.length - 2));
672
672
  }
673
- else if (q.length !== 2) throw new Error("配置错误!");
673
+ else if (q.length !== 2) throw new Error(i18n`配置错误!`);
674
674
  q = q[q.length - 2];
675
675
  }
676
676
  if (q instanceof RegExp) {
@@ -558,7 +558,7 @@ var createScoped = function (parsed, wash) {
558
558
  if (o.next.type === STAMP) {
559
559
  isAster = true;
560
560
  o = o.next;
561
- o.isExpress = op.isExpress;
561
+ o.isExpress = op?.isExpress;
562
562
  }
563
563
  case "catch":
564
564
  if (s === 'catch') isCatch = true;
@@ -917,7 +917,7 @@ var getDeclared = function (o, kind, queue) {
917
917
  break;
918
918
  default:
919
919
  console.log(o);
920
- throw new Error("代码结构异常");
920
+ throw new Error(i18n`代码结构异常`);
921
921
  }
922
922
  if (!o) break;
923
923
  switch (o.type) {
@@ -932,7 +932,7 @@ var getDeclared = function (o, kind, queue) {
932
932
  o.prev.equal = o;
933
933
  o = o.next;
934
934
  var o0 = skipAssignment(o);
935
- if (isrest) throw "余集变量不能有默认值";
935
+ if (isrest) throw i18n`余集变量不能有默认值`;
936
936
  attributes[attributes.length - 1].push(queue, o, o0);
937
937
  while (o !== o0) {
938
938
  skiped.push(o);
@@ -1046,7 +1046,7 @@ var createString = function (parsed) {
1046
1046
  var helpcode = parsed.helpcode;
1047
1047
  var express_reg = parsed.program?.express_reg;
1048
1048
  if (typeof helpcode === 'string') {
1049
- if (express_reg && !express_reg.test(helpcode.replace(/[\/\||,]/g, ''))) throw new Error("辅助级别异常:" + debug);
1049
+ if (express_reg && !express_reg.test(helpcode.replace(/[\/\||,]/g, ''))) throw new Error(i18n`辅助级别异常:` + debug);
1050
1050
  if (/[\/\|,]/i.test(helpcode)) var debug = `(?:${helpcode.replace(/[\/\|,]/g, '|')})`;
1051
1051
  else debug = helpcode;
1052
1052
  }
@@ -1105,7 +1105,7 @@ var createString = function (parsed) {
1105
1105
  result.push(tmp);
1106
1106
  if (/^\/\//.test(tmp)) lasttype = COMMENT;
1107
1107
  }
1108
- break;
1108
+ return;
1109
1109
  case SPACE:
1110
1110
  if (!autospace || keepspace || lasttype === COMMENT) {
1111
1111
  result.push(o.text);
@@ -4,9 +4,9 @@ var Program = scanner2.Program;
4
4
  var { STAMP, SCOPED, STRAP, EXPRESS, COMMENT, SPACE, PROPERTY, VALUE, LABEL, QUOTED, snapExpressFoot, isEval, canbeTemp, rename, isHalfSentence, skipFunction, getDeclared, skipAssignment, skipSentenceQueue, createScoped, createString, splice, relink, snapExpressHead, needBreakBetween } = require("./common");
5
5
  var splice2 = function (q, from, to, ...a) {
6
6
  var cx = q.indexOf(from);
7
- if (cx < 0) throw console.log(splice2.caller, console.format('\r\n<red2>自</red2>'), from && createString([from]), console.format('\r\n<yellow>至</yellow>'), to && createString([to]), console.format(`\r\n<cyan>码列</cyan>`), createString(q)), '结构异常';
7
+ if (cx < 0) throw console.log(splice2.caller, console.format(`\r\n<red2>${i18n`自`}</red2>`), from && createString([from]), console.format(`\r\n<yellow>${i18n`至`}</yellow>`), to && createString([to]), console.format(`\r\n<cyan>${i18n`码列`}</cyan>`), createString(q)), i18n`结构异常`;
8
8
  var dx = to ? q.indexOf(to, cx) : q.length;
9
- if (dx < 0) throw console.log(splice2.caller, console.format('\r\n<yellow>自</yellow>'), from && createString([from]), console.format('\r\n<red2>至</red2>'), to && createString([to]), console.format(`\r\n<cyan>码列</cyan>`), createString(q)), '结构异常';
9
+ if (dx < 0) throw console.log(splice2.caller, console.format(`\r\n<yellow>${i18n`自`}</yellow>`), from && createString([from]), console.format(`\r\n<red2>${i18n`至`}</red2>`), to && createString([to]), console.format(`\r\n<cyan>${i18n`码列`}</cyan>`), createString(q)), i18n`结构异常`;
10
10
  return splice(q, cx, dx - cx, ...a);
11
11
  };
12
12
  var insert1 = function (q, r, ...a) {
@@ -52,7 +52,7 @@ var killdec = function (queue, i, getobjname, _var = 'var', killobj, islet) {
52
52
  var [k, v] = d;
53
53
  var dp = 0;
54
54
  if (typeof k === 'number' && k < 0) {
55
- if (iter) throw "暂不支持在当前语境读取尾部非剩余元素";
55
+ if (iter) throw i18n`暂不支持在当前语境读取尾部非剩余元素`;
56
56
  dp = 1;
57
57
  k = `${tmpname}["length"]>${doged - k - 1}?${tmpname}[${tmpname}["length"] - ${-k}]:undefined`;
58
58
  } else {
@@ -1270,7 +1270,7 @@ var killarg = function (head, body, _getname, setarg = true) {
1270
1270
  index++;
1271
1271
  }
1272
1272
  }
1273
- else throw "参数声明异常!"
1273
+ else throw i18n`参数声明异常!`
1274
1274
  if (o && o.type === STAMP) {
1275
1275
  if (o.text === ',') {
1276
1276
  o = o.next; continue;
@@ -1589,7 +1589,7 @@ var down = function (scoped) {
1589
1589
  var body = scoped.body;
1590
1590
  if (!body) {
1591
1591
  var btemp = scoped.head.next;
1592
- if (!btemp) throw "语句不完整";
1592
+ if (!btemp) throw i18n`语句不完整`;
1593
1593
  var btmp2 = skipSentenceQueue(btemp);
1594
1594
  body = scoped.body = scanner2('{}')[0];
1595
1595
  splice(body, 0, 0, ...splice2(btemp.queue, btemp, btmp2, body));
@@ -480,8 +480,9 @@ var _return = function (r) {
480
480
  r.push(...x);
481
481
  relink(r);
482
482
  };
483
+
483
484
  var remove_end_comma = function (o) {
484
- if (!o.length || o.type !== SCOPED || o.entry === '[') return;
485
+ if (!o.length || (o.type !== void 0) && o.type !== SCOPED || o.entry === '[') return;
485
486
  for (var cx = o.length - 1; cx >= 0; cx--) {
486
487
  var m = o[cx];
487
488
  if (!(m.type & (SPACE | COMMENT))) {
@@ -570,6 +571,11 @@ var _invoke = function (t, getname) {
570
571
  }
571
572
  if (!iseval || m[m.length - 1] === o.last) {
572
573
  var q = toqueue(m, getdeepname, 1);
574
+ if (q.length > 1 && queue.length) {
575
+ var q0 = q[0];
576
+ var q0f = q0.first;
577
+ if (q0f?.type === STRAP && !q0f.transive) remove_end_comma(queue[queue.length - 1]);
578
+ }
573
579
  var qe = q[q.length - 1];
574
580
  splice(o, by, ey - by, ...qe ? cloneNode(qe.name) : []);
575
581
  cy = by + 1;
@@ -588,8 +594,7 @@ var _invoke = function (t, getname) {
588
594
  nameindex = _nameindex;
589
595
  // if (!cache.length) continue;
590
596
  if (queue.length) flushqueue(result, queue), queue = [];
591
- for (var c of cache) pushstep(result, c);
592
- cache = [];
597
+ if (cache.length) flushqueue(result, cache), cache = [];
593
598
  var n = o.next;
594
599
  if (n && !needbreak(n)) {
595
600
  lastlink = n.type === SCOPED;
@@ -1119,7 +1124,7 @@ var poplabel = function (result) {
1119
1124
  var r = result[cx];
1120
1125
  if (r.indexOf(b) >= 0) { break }
1121
1126
  }
1122
- if (cx < 0) throw console.log(result.map(r => createString(r)), e.text, createString([b.prev, b])), "break语句异常";
1127
+ if (cx < 0) throw console.log(result.map(r => createString(r)), e.text, createString([b.prev, b])), i18n`break语句异常`;
1123
1128
  end.push({ type: VALUE, text: b.continue ? b.continue.contat - cx : result.length - cx }, { type: STAMP, text: "," }, { type: VALUE, text: "0" });
1124
1129
  relink(end);
1125
1130
  }
@@ -153,4 +153,5 @@ test(`c=b+ !a`, "_ = !a, c = b + _");
153
153
  test(`do {var loadcount = 0;} while (loadcount !== 0);`, `loadcount = 0; _ = loadcount !== 0; if (_) return [0, 0]`);
154
154
  unstruct.debug = true; r++;
155
155
  test("if(a)try{a}catch{};a;", 'if (!a) return [4, 0]; return [1, 7];\r\n a; return [0, 9];\r\n return [1, 9];\r\n return [1, 0];\r\n a');
156
- test("url = (o===void 0||o===null?void 0:o.url)", '_ = void 0, _ = o === _; if (_) return [1, 0]; _ = o === null;\r\n if (!_) return [1, 0]; _ = void 0; return [2, 0];\r\n _ = o.url; return [1, 0];\r\n url = _', true);
156
+ test("url = (o===void 0||o===null?void 0:o.url)", '_ = void 0, _ = o === _; if (_) return [1, 0]; _ = o === null;\r\n if (!_) return [1, 0]; _ = void 0; return [2, 0];\r\n _ = o.url; return [1, 0];\r\n url = _', true);
157
+ test("p ? (ishttps ? `https` : `http`).toUpperCase() + i18n`端口` + (ishttps ? ': ' : ': ') + p : ''","if (!p) return [1, 0]; if (!ishttps) return [1, 0]; _0 = `https`; return [2, 0];\r\n _0 = `http`; return [1, 0];\r\n _0 = (_0); _1 = _0.toUpperCase(); _ = _1 + i18n`端口`; if (!ishttps) return [1, 0]; _2 = ': '; return [2, 0];\r\n _2 = ': '; return [1, 0];\r\n _ = _ + (_2), _ = _ + p; return [2, 0];\r\n ''; return [1, 0]")
@@ -70,7 +70,7 @@ var washcode = function (code, pick) {
70
70
  var called_map = Object.create(null);
71
71
  for (var cx = 0, dx = explist.length; cx < dx; cx++) {
72
72
  var exp = explist[cx];
73
- console.info(`正在处理:${1 + cx}/${dx}`);
73
+ console.info(i18n`正在处理:${1 + cx}/${dx}`);
74
74
  var scoped = createScoped(exp);
75
75
  var refs = createRefMap(scoped);
76
76
  var used = scoped.used;
@@ -190,7 +190,7 @@ var washcode = function (code, pick) {
190
190
  ws = writed_map[ks.join('.')];
191
191
  }
192
192
  if (!ws) {
193
- if (!(ks[0] in envs) && !/^(arguments|this|true|false|null)$/.test(ks[0])) console.warn(`检测到错误,无法建立代码关联:${k}`);
193
+ if (!(ks[0] in envs) && !/^(arguments|this|true|false|null)$/.test(ks[0])) console.warn(i18n`检测到错误,无法建立代码关联:${k}`);
194
194
  prevent_map[k] = true;
195
195
  continue;
196
196
  }
@@ -32,7 +32,7 @@ var execute = function (commName, then, logpad) {
32
32
  warn: log.bind("#fc0", '警告'),
33
33
  };
34
34
  window.onerror = a => console.error(a);
35
- window.console.info(`load ${commName}!`);
35
+ window.console.info(i18n`加载 ${commName}!`);
36
36
 
37
37
  init(commName, function (comm) {
38
38
  window[commName] = function () {
@@ -34,12 +34,12 @@ e.open = async function (p) {
34
34
  });
35
35
  this.selected = files.filter(f => f.selected);
36
36
  }
37
- e.delete = function () { alert("无法删除!") }
38
- e.mov = function () { alert("无法移动!") }
39
- e.copy = function () { alert("无法复制!") }
40
- e.read = function () { alert("无法读取文件内容!") }
41
- e.rename = function () { alert("无法重命名!") }
42
- e.upload = function () { alert("添加失败!") }
37
+ e.delete = function () { alert(i18n`无法删除!`) }
38
+ e.mov = function () { alert(i18n`无法移动!`) }
39
+ e.copy = function () { alert(i18n`无法复制!`) }
40
+ e.read = function () { alert(i18n`无法读取文件内容!`) }
41
+ e.rename = function () { alert(i18n`无法重命名!`) }
42
+ e.upload = function () { alert(i18n`添加失败!`) }
43
43
  e.getToken = function () { }
44
44
  e.uploadAll = async function (files) {
45
45
  var $scope = this;