use of com.google.javascript.jscomp.parsing.parser.trees.GetAccessorTree 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);
BlockTree body = parseFunctionBody();
recordFeatureUsed(Feature.GETTER);
return new GetAccessorTree(getTreeLocation(partial.start), propertyName, partial.isStatic, body);
} else {
ParseTree property = parseComputedPropertyName();
eat(TokenType.OPEN_PAREN);
eat(TokenType.CLOSE_PAREN);
BlockTree body = parseFunctionBody();
recordFeatureUsed(Feature.GETTER);
return new ComputedPropertyGetterTree(getTreeLocation(partial.start), property, partial.isStatic, body);
}
}
Aggregations