コード例 #1
0
  @Override
  public void visitFunctionDeclaration(FunctionDeclarationTree tree) {
    newFunctionScope(tree);

    skipBlock(tree.body());
    super.visitFunctionDeclaration(tree);

    leaveScope();
  }
コード例 #2
0
  @Test
  public void generator() throws Exception {
    FunctionDeclarationTree tree = parse("function* g() {}", Kind.GENERATOR_DECLARATION);

    assertThat(tree.is(Kind.GENERATOR_DECLARATION)).isTrue();
    assertThat(tree.functionKeyword().text()).isEqualTo("function");
    assertThat(tree.starToken()).isNotNull();
    assertThat(tree.parameters()).isNotNull();
    assertThat(tree.body()).isNotNull();
  }