use of com.google.template.soy.shared.internal.BuiltinFunction in project closure-templates by google.
the class SoyNodeCompiler method shouldCheckBuffer.
/**
* Returns true if the print expression should check the rendering buffer and generate a detach.
*
* <p>We do not generate detaches for css() and xid() builtin functions, since they are typically
* very short.
*/
private static boolean shouldCheckBuffer(PrintNode node) {
if (!(node.getExpr().getRoot() instanceof FunctionNode)) {
return true;
}
FunctionNode fn = (FunctionNode) node.getExpr().getRoot();
if (!(fn.getSoyFunction() instanceof BuiltinFunction)) {
return true;
}
BuiltinFunction bfn = (BuiltinFunction) fn.getSoyFunction();
if (bfn != BuiltinFunction.XID && bfn != BuiltinFunction.CSS) {
return true;
}
return false;
}
Aggregations