use of com.google.template.soy.jssrc.restricted.JsExpr in project closure-templates by google.
the class ChangeNewlineToBrDirectiveTest method testApplyForJsSrc.
@Test
public void testApplyForJsSrc() {
ChangeNewlineToBrDirective directive = new ChangeNewlineToBrDirective();
JsExpr dataRef = new JsExpr("opt_data.myKey", Integer.MAX_VALUE);
assertThat(directive.applyForJsSrc(dataRef, ImmutableList.<JsExpr>of()).getText()).isEqualTo("soy.$$changeNewlineToBr(opt_data.myKey)");
}
use of com.google.template.soy.jssrc.restricted.JsExpr in project closure-templates by google.
the class FilterImageDataUriDirectiveTest method testApplyForJsSrc.
@Test
public void testApplyForJsSrc() {
FilterImageDataUriDirective cleanHtml = new FilterImageDataUriDirective();
JsExpr dataRef = new JsExpr("opt_data.myKey", Integer.MAX_VALUE);
assertThat(cleanHtml.applyForJsSrc(dataRef, ImmutableList.<JsExpr>of()).getText()).isEqualTo("soy.$$filterImageDataUri(opt_data.myKey)");
}
use of com.google.template.soy.jssrc.restricted.JsExpr in project closure-templates by google.
the class AugmentMapFunctionTest method testComputeForJsSrc.
@Test
public void testComputeForJsSrc() {
AugmentMapFunction augmentMapFunction = new AugmentMapFunction();
JsExpr baseMapExpr = new JsExpr("BASE_MAP_JS_CODE", Integer.MAX_VALUE);
JsExpr additionalMapExpr = new JsExpr("ADDITIONAL_MAP_JS_CODE", Integer.MAX_VALUE);
assertThat(augmentMapFunction.computeForJsSrc(ImmutableList.of(baseMapExpr, additionalMapExpr))).isEqualTo(new JsExpr("soy.$$augmentMap(BASE_MAP_JS_CODE, ADDITIONAL_MAP_JS_CODE)", Integer.MAX_VALUE));
}
use of com.google.template.soy.jssrc.restricted.JsExpr in project closure-templates by google.
the class BidiTextDirFunction method computeForJsSrc.
@Override
public JsExpr computeForJsSrc(List<JsExpr> args) {
JsExpr value = args.get(0);
JsExpr isHtml = (args.size() == 2) ? args.get(1) : null;
String callText = (isHtml != null) ? "soy.$$bidiTextDir(" + value.getText() + ", " + isHtml.getText() + ")" : "soy.$$bidiTextDir(" + value.getText() + ")";
return new JsExpr(callText, Integer.MAX_VALUE);
}
use of com.google.template.soy.jssrc.restricted.JsExpr in project closure-templates by google.
the class BidiMarkAfterFunction method computeForJsSrc.
@Override
public JsExpr computeForJsSrc(List<JsExpr> args) {
JsExpr value = args.get(0);
JsExpr isHtml = (args.size() == 2) ? args.get(1) : null;
String callText = "soy.$$bidiMarkAfter(" + bidiGlobalDirProvider.get().getCodeSnippet() + ", " + value.getText() + (isHtml != null ? ", " + isHtml.getText() : "") + ")";
return new JsExpr(callText, Integer.MAX_VALUE);
}
Aggregations