Skip to content

Commit

Permalink
Add a couple more InlineVariables tests.
Browse files Browse the repository at this point in the history
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=154724081
  • Loading branch information
tbreisacher authored and brad4d committed May 2, 2017
1 parent 02ee72c commit a30a9a5
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion test/com/google/javascript/jscomp/InlineVariablesTest.java
Expand Up @@ -80,7 +80,7 @@ public void testInlineIntoRhsOfAssign() {
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; }");
}
Expand Down Expand Up @@ -121,6 +121,16 @@ public void testInlineInFunction5() {
"}");
}

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;"),
Expand Down

0 comments on commit a30a9a5

Please sign in to comment.