Rewrite temporary variable elimination
This commit is contained in:
+17
@@ -0,0 +1,17 @@
|
||||
function test1(n) {
|
||||
var $tmp;
|
||||
if (n > 0) {
|
||||
$tmp = 23;
|
||||
}
|
||||
return typeof $tmp;
|
||||
}
|
||||
|
||||
function box() {
|
||||
var result = test1(5);
|
||||
if (result != "number") return "fail1: " + result;
|
||||
|
||||
result = test1(-5);
|
||||
if (result != "undefined") return "fail2: " + result;
|
||||
|
||||
return "OK";
|
||||
}
|
||||
Reference in New Issue
Block a user