Add a couple more InlineVariables tests.
@@ -80,7 +80,7 @@ public final class InlineVariablesTest extends CompilerTestCase {
test("var x = 1; var y = x;", "var y = 1;");
}
- public void testInlineInFunction() {
+ public void testInlineInFunction1() {
test("function baz() { var x = 1; var z = x; }",
"function baz() { var z = 1; }");
}
@@ -121,6 +121,16 @@ public final class InlineVariablesTest extends CompilerTestCase {
"}");
}
+ public void testInlineInFunction6() {
+ test("function baz() { { var x = 1; var z = x; } }",
+ "function baz() { { var z = 1; } }");
+ }
+
+ public void testInlineInFunction7() {
+ test("function baz() { var x = 1; { var z = x; } }",
+ "function baz() { { var z = 1; } }");
+ }
+
public void testInlineAcrossModules() {
// TODO(kushal): Make decision about overlap with CrossModuleCodeMotion
test(createModules("var a = 2;", "var b = a;"),
