efront 4.0.7 → 4.0.9
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.
|
@@ -982,7 +982,7 @@ var unforof = function (o, getnewname, used) {
|
|
|
982
982
|
splice(o, o.length, 0, { type: STAMP, text: ',' });
|
|
983
983
|
}
|
|
984
984
|
if (useSimpleLoop) splice(o, o.length, 0, ...scanner2(`${iname}=0,${gname}=${oname}["length"];${iname}<${gname}&&(${createString([p])}=${oname}[${iname}],true);${iname}++`));
|
|
985
|
-
else rootenvs.Symbol = true, splice(o, o.length, 0, ...scanner2(`${gname}=${hasawait ? `${oname}[Symbol["asyncIterator"]]||${oname}[Symbol["iterator"]]` : `${oname}[Symbol["iterator"]]||${oname}[Symbol["asyncIterator"]]`}||Array["prototype"][Symbol["iterator"]],${gname}=${gname}["call"](${oname}),${iname}=${hasawait ? "await " : ''}${gname}["next"]();!${iname}["done"]&&(${createString([p])}=${iname}["value"],true);${iname}=${gname}["next"]()`));
|
|
985
|
+
else rootenvs.Symbol = true, splice(o, o.length, 0, ...scanner2(`${gname}=${hasawait ? `${oname}[Symbol["asyncIterator"]]||${oname}[Symbol["iterator"]]` : `${oname}[Symbol["iterator"]]||${oname}[Symbol["asyncIterator"]]`}||Array["prototype"][Symbol["iterator"]],${gname}=${gname}["call"](${oname}),${iname}=${hasawait ? "await " : ''}${gname}["next"]();!${iname}["done"]&&(${createString([p])}=${iname}["value"],true);${iname}=${hasawait ? 'await ' : ''}${gname}["next"]()`));
|
|
986
986
|
relink(o);
|
|
987
987
|
};
|
|
988
988
|
var unarrow = function (body, i, killobj, letname_) {
|
|
@@ -200,7 +200,10 @@ function () {
|
|
|
200
200
|
_2 = !_["done"]; if (!_2) return [1, 0]; o = _["value"]; _2 = (true)
|
|
201
201
|
},
|
|
202
202
|
function () {
|
|
203
|
-
if (!_2) return [
|
|
203
|
+
if (!_2) return [2, 0]; noSymbol; _2 = _0["next"](); return [_2, 1]
|
|
204
|
+
},
|
|
205
|
+
function (_1) {
|
|
206
|
+
_2 = _1; _ = _2; return [-2, 0]
|
|
204
207
|
})
|
|
205
208
|
var _, _0, _2`)
|
|
206
209
|
assert(downLevel(`for await(var [o,s] of os) noSymbol`), `return async_(
|
|
@@ -217,7 +220,10 @@ function () {
|
|
|
217
220
|
_3 = !_["done"]; if (!_3) return [1, 0]; _1 = _["value"]; o = _1[0]; s = _1[1]; _3 = (true)
|
|
218
221
|
},
|
|
219
222
|
function () {
|
|
220
|
-
if (!_3) return [
|
|
223
|
+
if (!_3) return [2, 0]; noSymbol; _3 = _0["next"](); return [_3, 1]
|
|
224
|
+
},
|
|
225
|
+
function (_2) {
|
|
226
|
+
_3 = _2; _ = _3; return [-2, 0]
|
|
221
227
|
})
|
|
222
228
|
var o, s, _, _0, _1, _3`)
|
|
223
229
|
assert(downLevel(`for(o of os) noSymbol`), `for (_ = 0, _0 = os["length"]; _ < _0 && (o = os[_], true); _++) noSymbol\r\nvar _, _0`)
|
package/coms/compile/unstruct.js
CHANGED
|
@@ -8,7 +8,8 @@ var THROW = { type: STRAP, text: "@throw" };// return;
|
|
|
8
8
|
var YIELD = { type: STRAP, text: "@yield" };// return;
|
|
9
9
|
var NEXT = { type: STRAP, text: "@next" };// return;
|
|
10
10
|
var _break = function (body, cx, result, iscontinue) {
|
|
11
|
-
|
|
11
|
+
var re = result[result.length - 1];
|
|
12
|
+
if (!result.length || re.ret_ && !re.await_ && re.ret_ !== -2) return;
|
|
12
13
|
var label;
|
|
13
14
|
do {
|
|
14
15
|
var o = body[++cx];
|
|
@@ -37,7 +38,7 @@ var _break = function (body, cx, result, iscontinue) {
|
|
|
37
38
|
else {
|
|
38
39
|
for (var cx = labels.length - 1; cx >= 0; cx--) {
|
|
39
40
|
var b = labels[cx];
|
|
40
|
-
if (b.type !== LABEL) {
|
|
41
|
+
if (b.type !== LABEL && (!iscontinue || b.text !== 'switch')) {
|
|
41
42
|
if (!b.breaks) b.breaks = [];
|
|
42
43
|
var _b = scanner2("return []");
|
|
43
44
|
_b.ret_ = -1;
|
|
@@ -94,4 +94,5 @@ test(`cc.name += "<f test></f>"`, `_ = cc.name + "<f test></f>"; cc.name = _`, t
|
|
|
94
94
|
test("yield a", 'return [a, 3]', true);
|
|
95
95
|
test("throw a", 'throw a', true);
|
|
96
96
|
test("debugger", 'debugger', true);
|
|
97
|
-
test("a(b,b+=1)", '_ = b; _0 = b + 1; b = _0; a(_, _0)', true);
|
|
97
|
+
test("a(b,b+=1)", '_ = b; _0 = b + 1; b = _0; a(_, _0)', true);
|
|
98
|
+
test("while(a){if(b){if(c);else d;continue;}}", 'if (!a) return [4, 0]; if (!b) return [3, 0]; if (!c) return [1, 0]; return [2, 0];\r\n d; return [1, 0];\r\n return [-2, 0];\r\n return [-3, 0]', true);
|