Clean up transformations after #714.
Since now we have runtime helper, we don't need expression -> statement conversions anymore.
This commit is contained in:
@@ -5,9 +5,5 @@
|
||||
console.log(this, arguments);
|
||||
return "foo";
|
||||
}
|
||||
if (Math.random() > 0.5) {
|
||||
return to5Runtime.tailCall(f.call, [this, n - 1], f);
|
||||
} else {
|
||||
return to5Runtime.tailCall(f.apply, [this, [n - 1]], f);
|
||||
}
|
||||
return Math.random() > 0.5 ? to5Runtime.tailCall(f.call, [this, n - 1], f) : to5Runtime.tailCall(f.apply, [this, [n - 1]], f);
|
||||
})(1000000) === "foo";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
function f(n) {
|
||||
return n <= 0 ? "foo" : g(n - 1);
|
||||
return n <= 0 ? "foo" : g(n - 1);
|
||||
}
|
||||
|
||||
function g(n) {
|
||||
return n <= 0 ? "goo" : f(n - 1);
|
||||
return n <= 0 ? "goo" : f(n - 1);
|
||||
}
|
||||
|
||||
@@ -1,17 +1,9 @@
|
||||
"use strict";
|
||||
|
||||
function f(n) {
|
||||
if (n <= 0) {
|
||||
return "foo";
|
||||
} else {
|
||||
return to5Runtime.tailCall(g, [n - 1]);
|
||||
}
|
||||
return n <= 0 ? "foo" : to5Runtime.tailCall(g, [n - 1]);
|
||||
}
|
||||
|
||||
function g(n) {
|
||||
if (n <= 0) {
|
||||
return "goo";
|
||||
} else {
|
||||
return to5Runtime.tailCall(f, [n - 1]);
|
||||
}
|
||||
return n <= 0 ? "goo" : to5Runtime.tailCall(f, [n - 1]);
|
||||
}
|
||||
|
||||
@@ -1,18 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
(function f(n) {
|
||||
var _temp;
|
||||
if (n <= 0) {
|
||||
return "foo";
|
||||
} else {
|
||||
doSmth();
|
||||
|
||||
if (!(_temp = getTrueValue())) {
|
||||
return _temp;
|
||||
}
|
||||
if (_temp = getFalseValue()) {
|
||||
return _temp;
|
||||
}
|
||||
return to5Runtime.tailCall(f, [n - 1]);
|
||||
}
|
||||
return n <= 0 ? "foo" : (doSmth(), getTrueValue() && (getFalseValue() || to5Runtime.tailCall(f, [n - 1])));
|
||||
})(1000000, true) === "foo";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
function f() {
|
||||
return getObj().method();
|
||||
return getObj().method();
|
||||
}
|
||||
|
||||
function g() {
|
||||
|
||||
@@ -6,9 +6,5 @@ function f() {
|
||||
}
|
||||
|
||||
function g() {
|
||||
var _temp;
|
||||
if (_temp = getFalseValue()) {
|
||||
return _temp;
|
||||
}
|
||||
return to5Runtime.tailCall(getValue);
|
||||
return getFalseValue() || to5Runtime.tailCall(getValue);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user