efront 4.3.9 → 4.3.10

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.
@@ -55,6 +55,7 @@ var skipAssignment = function (o, cx) {
55
55
  break;
56
56
  case "++":
57
57
  case "--":
58
+ if (needpunc && o.unary) break loop;
58
59
  next();
59
60
  break;
60
61
  case "!":
@@ -969,7 +969,7 @@ var _express = function (body, getname, ret) {
969
969
  if (/^([!~]|\+\-|\-\+)*$/.test(o.text)) p = powermap["!"];
970
970
  if (!p && /^[\+\-]$/.test(o.text)) p = needpunc ? powermap["+"] : powermap["!"];
971
971
  if (!p) p = powermap[o.text];
972
- needpunc = /^(\+\+|\-\-)$/.test(o.text) ? needpunc : false;
972
+ if (o.unary) needpunc = false;
973
973
  var b = body.slice(bx, cx + 1);
974
974
  bx = cx + 1;
975
975
  b.index = nameindex;
@@ -137,7 +137,6 @@ test("rgb=(rgb<<8|rgb>>16)&0xffffff", "_ = rgb << 8, _0 = rgb >> 16, _ = _ | _0;
137
137
  test(`if (c) a; else return true; return false`, "if (!c) return [1, 0]; a; return [2, 0];\r\n return [true, 2];\r\n return [false, 2]")
138
138
  test(`switch(a){case a:a=a?1:0;break;case b:a=b;break;}`, "if (a === a) return [1, 0]; if (a === b) return [4, 0]; return [5, 0];\r\n if (!a) return [1, 0]; a = 1; return [2, 0];\r\n a = 0; return [1, 0];\r\n return [2, 0];\r\n a = b; return [1, 0]");
139
139
  test(`a=typeof a!==1`, "_ = typeof a, a = _ !== 1");
140
- unstruct.debug = true; r++;
141
140
  test(`a[0]++`, "a[0]++");
142
141
  test(`1+a[0]++`, "_ = a[0]++, 1 + _");
143
142
  test(`a[0]++ + 1`, "_ = a[0]++, _ + 1");
@@ -145,3 +144,7 @@ test(`a[0]-- + 1`, "_ = a[0]--, _ + 1");
145
144
  test(`a[0]-- +1`, "_ = a[0]--, _ + 1");
146
145
  test(`a[0]--+1`, "_ = a[0]--, _ + 1");
147
146
  test(`a[0]+++1`, "_ = a[0]++, _ + 1");
147
+ unstruct.debug = true; r++;
148
+ test(`c=b\r\n++a`, "c = b; ++a");
149
+ test(`c=b+\r\n++a`, "_ =\r\n++a, c = b + _");
150
+ test(`c=b+ ++a`, "_ = ++a, c = b + _");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efront",
3
- "version": "4.3.9",
3
+ "version": "4.3.10",
4
4
  "description": "简化前端开发,优化web性能",
5
5
  "main": "public/efront.js",
6
6
  "directories": {