use of com.google.javascript.jscomp.parsing.parser.trees.SetAccessorTree in project closure-compiler by google.
the class Parser method parseSetAccessor.
private ParseTree parseSetAccessor(PartialClassElement partial) {
eatPredefinedString(PredefinedName.SET);
if (peekPropertyName(0)) {
Token propertyName = eatObjectLiteralPropertyName();
FormalParameterListTree parameter = parseSetterParameterList();
BlockTree body = parseFunctionBody();
recordFeatureUsed(Feature.SETTER);
return new SetAccessorTree(getTreeLocation(partial.start), propertyName, partial.isStatic, parameter, body);
} else {
ParseTree property = parseComputedPropertyName();
FormalParameterListTree parameter = parseSetterParameterList();
BlockTree body = parseFunctionBody();
recordFeatureUsed(Feature.SETTER);
return new ComputedPropertySetterTree(getTreeLocation(partial.start), property, partial.isStatic, parameter, body);
}
}
Aggregations