use of com.google.javascript.jscomp.parsing.parser.trees.ComputedPropertyGetterTree in project closure-compiler by google.
the class Parser method parseGetAccessor.
private ParseTree parseGetAccessor(PartialClassElement partial) {
eatPredefinedString(PredefinedName.GET);
if (peekPropertyName(0)) {
Token propertyName = eatObjectLiteralPropertyName();
eat(TokenType.OPEN_PAREN);
eat(TokenType.CLOSE_PAREN);
ParseTree returnType = maybeParseColonType();
BlockTree body = parseFunctionBody();
return new GetAccessorTree(getTreeLocation(partial.start), propertyName, partial.isStatic, returnType, body);
} else {
ParseTree property = parseComputedPropertyName();
eat(TokenType.OPEN_PAREN);
eat(TokenType.CLOSE_PAREN);
ParseTree returnType = maybeParseColonType();
BlockTree body = parseFunctionBody();
return new ComputedPropertyGetterTree(getTreeLocation(partial.start), property, partial.isStatic, partial.accessModifier, returnType, body);
}
}
Aggregations