Skip to content

Commit

Permalink
Remove ExpressionStatement from CFG (#321)
Browse files Browse the repository at this point in the history
  • Loading branch information
pynicolas authored Aug 9, 2016
1 parent 239e45c commit b8fa262
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ private void build(List<? extends Tree> trees) {

private void build(Tree tree) {
if (tree.is(Kind.EXPRESSION_STATEMENT)) {
currentBlock.addElement(tree);
buildExpression(((ExpressionStatementTree) tree).expression());
} else if (tree.is(Kind.VARIABLE_STATEMENT)) {
buildExpression(((VariableStatementTree) tree).declaration());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,11 @@ public class SeChecksDispatcherTest {
public void test() throws Exception {
SeChecksDispatcher seChecksDispatcher = new SeChecksDispatcher(ImmutableList.<SeCheck>of(new TestSeCheck()));
List<Issue> issues = seChecksDispatcher.scanFile(createContext(new File("src/test/resources/se/se_dispatcher_test.js")));
assertThat(issues).hasSize(6);
assertThat(issues).hasSize(4);
assertThat(((PreciseIssue) issues.get(0)).primaryLocation().message()).isEqualTo("Start of execution");
assertThat(((PreciseIssue) issues.get(1)).primaryLocation().message()).isEqualTo("before element");
assertThat(((PreciseIssue) issues.get(2)).primaryLocation().message()).isEqualTo("after element");
assertThat(((PreciseIssue) issues.get(3)).primaryLocation().message()).isEqualTo("before element");
assertThat(((PreciseIssue) issues.get(4)).primaryLocation().message()).isEqualTo("after element");
assertThat(((PreciseIssue) issues.get(5)).primaryLocation().message()).isEqualTo("End of execution");
assertThat(((PreciseIssue) issues.get(3)).primaryLocation().message()).isEqualTo("End of execution");
}

private class TestSeCheck extends SeCheck {
Expand Down

0 comments on commit b8fa262

Please sign in to comment.