efront 4.19.1 → 4.19.2

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.
@@ -327,6 +327,7 @@ var _while = function (body, cx, unblock, result) {
327
327
  var b = rescan`if (${getCondition(o, unblock, true)}) return []`;
328
328
  var be = b[b.length - 1];
329
329
  pushstep(result, b);
330
+ var i2 = result.length - 1;
330
331
  relink(result[result.length - 1]);
331
332
  var block = getblock(body, ++cx);
332
333
  cx += block.length;
@@ -335,7 +336,8 @@ var _while = function (body, cx, unblock, result) {
335
336
  var we = wend[wend.length - 1];
336
337
  pushstep(result, wend);
337
338
  we[0].text = String(1 + i - result.length);
338
- be.push(...scanner2(`${result.length - i}, 0`));
339
+ be.push(...scanner2(`${result.length - i2}, 0`));
340
+
339
341
  relink(be);
340
342
  return cx;
341
343
  };
@@ -161,4 +161,6 @@ test("if(a){if(b){c}else{d}}else{e}", `if (!a) return [3, 0]; if (!b) return [1,
161
161
  test("if(a&&b||c){d}", `_ = a; if (!_) return [1, 0]; _ = b;\r\n if (_) return [1, 0]; _ = c;\r\n if (!_) return [1, 0]; d; return [1, 0]`, true);
162
162
  test("if(a)switch(b){case c:d;break;} else{h}", `if (!a) return [3, 0]; if (b === c) return [1, 0]; return [2, 0];\r\n d; return [1, 0];\r\n return [2, 0];\r\n h; return [1, 0]`)
163
163
  test("var res = null, krc;", `res = null; krc`)
164
- test("res = null, krc;", `res = null; krc`)
164
+ test("res = null, krc;", `res = null; krc`)
165
+ test(`while (a && b);`, '_ = a; if (!_) return [1, 0]; _ = b;\r\n if (!_) return [1, 0]; return [-1, 0]', true);
166
+ test(`while (a < b);`, '_ = a < b; if (!_) return [1, 0]; return [0, 0]', true);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efront",
3
- "version": "4.19.1",
3
+ "version": "4.19.2",
4
4
  "description": "简化前端开发,优化web性能",
5
5
  "main": "public/efront.js",
6
6
  "directories": {