diff --git a/test/normalization/cram/for-statements.t/run.t b/test/normalization/cram/for-statements.t/run.t index dca4a1e..f534d15 100644 --- a/test/normalization/cram/for-statements.t/run.t +++ b/test/normalization/cram/for-statements.t/run.t @@ -6,7 +6,8 @@ src["2"] = 3; let dest; dest = []; - for (var p in src) { + for (var v1 in src) { + p = v1; x = src[p]; y = dest[p]; } @@ -20,8 +21,9 @@ $ ast_gen input-code-3.js -o out; cat out/code/input-code-3.js; echo; rm -fr out; let extend; - extend = function (dest, src) { - for (var p in src) { + extend = function (src, dest) { + for (var v1 in src) { + p = v1; x = src[p]; y = dest[p]; } @@ -33,14 +35,17 @@ iterable["0"] = 10; iterable["1"] = 20; iterable["2"] = 30; - for (let value of iterable) { - let v1; - v1 = console.log(value); + for (let v1 of iterable) { + value = v1; + let v2; + v2 = console.log(value); } $ ast_gen input-code-5.js -o out; cat out/code/input-code-5.js; echo; rm -fr out; - ast_gen: internal error, uncaught exception: - Failure("hd") - - cat: out/code/input-code-5.js: No such file or directory + for (let v1 of iterable) { + key = v1[0]; + value = v1[1]; + let v2; + v2 = console.log(value); + } diff --git a/test/normalization/cram/function-declarations.t/run.t b/test/normalization/cram/function-declarations.t/run.t index a27f606..a22a79b 100644 --- a/test/normalization/cram/function-declarations.t/run.t +++ b/test/normalization/cram/function-declarations.t/run.t @@ -7,7 +7,7 @@ $ ast_gen input-code-2.js -o out; cat out/code/input-code-2.js; echo; rm -fr out; let f; - f = function (x, y, z) { + f = function (z, y, x) { let v1; v1 = x; x = x + 1; diff --git a/test/normalization/cram/spread-elements.t/run.t b/test/normalization/cram/spread-elements.t/run.t index 09efe45..d64fcc3 100644 --- a/test/normalization/cram/spread-elements.t/run.t +++ b/test/normalization/cram/spread-elements.t/run.t @@ -1,6 +1,5 @@ - $ ast_gen input-code-1.js -o out; cat out/code/input-code-1.js; echo; rm -fr out; - ast_gen: internal error, uncaught exception: + $ ast_gen input-code-1.js -o out 2>&1 | grep "Failure" && cat out/code/input-code-1.js && echo && rm -fr out Failure("[ERROR] Cannot process spread array element") - cat: out/code/input-code-1.js: No such file or directory - + [1] + diff --git a/test/normalization/cram/template-expressions.t/run.t b/test/normalization/cram/template-expressions.t/run.t index ae7a900..682fa9e 100644 --- a/test/normalization/cram/template-expressions.t/run.t +++ b/test/normalization/cram/template-expressions.t/run.t @@ -2,14 +2,17 @@ const x; x = `string`; + $ ast_gen input-code-2.js -o out; cat out/code/input-code-2.js; echo; rm -fr out; const x; x = `string` + `concat`; + $ ast_gen input-code-3.js -o out; cat out/code/input-code-3.js; echo; rm -fr out; const x; x = `template ${expr}`; + $ ast_gen input-code-4.js -o out; cat out/code/input-code-4.js; echo; rm -fr out; const x; x = `string`; @@ -18,10 +21,10 @@ v1 = x + 2; temp = `head template ${v1} end tail`; - $ ast_gen input-code-5.js -o out; cat out/code/input-code-5.js; echo; rm -fr out; - ast_gen: internal error, uncaught exception: + + $ ast_gen input-code-5.js -o out 2>&1 | grep "Failure" && cat out/code/input-code-5.js && echo && rm -fr out Failure("[ERROR] Unknown expression type to normalize (object on (9, 15) to (9, 60))") - cat: out/code/input-code-5.js: No such file or directory - + [1] + x diff --git a/test/normalization/cram/yield-expressions.t/run.t b/test/normalization/cram/yield-expressions.t/run.t index 03528fa..1523a8a 100644 --- a/test/normalization/cram/yield-expressions.t/run.t +++ b/test/normalization/cram/yield-expressions.t/run.t @@ -1,15 +1,17 @@ $ ast_gen input-code-1.js -o out; cat out/code/input-code-1.js; echo; rm -fr out; let foo; foo = function (index) { - yield index; + let v1; + v1 = yield index; } $ ast_gen input-code-2.js -o out; cat out/code/input-code-2.js; echo; rm -fr out; let foo; foo = function (index) { let v1; - v1 = index; + let v2; + v2 = index; index = index + 1; - yield v1; + v1 = yield v2; }