Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix soyutils.js so that it compiles with strict settings in the Closu…

…re Compiler.

Fixes for explicit Guice binding support in Soy.

Revision created by MOE tool push_codebase.
MOE_MIGRATION=


git-svn-id: http://closure-templates.googlecode.com/svn/trunk@23 ba6e359a-b4f9-11de-880b-11b4e8d67c75
  • Loading branch information...
commit d910ccbb8988a02d8741c19552593925aca075df 1 parent fc48ec3
bolinfest authored
View
BIN  java/lib/icu4j-core.jar
Binary file not shown
View
2  java/src/com/google/template/soy/SoyModule.java
@@ -25,6 +25,7 @@
import com.google.template.soy.bidifunctions.BidiFunctionsModule;
import com.google.template.soy.javasrc.internal.JavaSrcModule;
import com.google.template.soy.jssrc.internal.JsSrcModule;
+import com.google.template.soy.parsepasses.CheckFunctionCallsVisitor;
import com.google.template.soy.parsepasses.PerformAutoescapeVisitor;
import com.google.template.soy.parsepasses.contextautoesc.ContextualAutoescaper;
import com.google.template.soy.shared.internal.SharedModule;
@@ -48,6 +49,7 @@
install(new JavaSrcModule());
// Bindings for when explicit dependencies are required.
+ bind(CheckFunctionCallsVisitor.class);
bind(ContextualAutoescaper.class);
bind(PerformAutoescapeVisitor.class);
View
10 java/src/com/google/template/soy/sharedpasses/SharedPassesModule.java
@@ -18,8 +18,7 @@
import com.google.inject.AbstractModule;
import com.google.template.soy.shared.internal.SharedModule;
-import com.google.template.soy.sharedpasses.opti.PreevalVisitorFactory;
-import com.google.template.soy.sharedpasses.opti.PrerenderVisitorFactory;
+import com.google.template.soy.sharedpasses.opti.OptiModule;
import com.google.template.soy.sharedpasses.render.EvalVisitor.EvalVisitorFactory;
import com.google.template.soy.sharedpasses.render.EvalVisitorFactoryImpl;
import com.google.template.soy.sharedpasses.render.RenderVisitor.RenderVisitorFactory;
@@ -41,9 +40,10 @@
// Install requisite modules.
install(new SharedModule());
- // Bindings for when explicit dependencies are required.
- bind(PreevalVisitorFactory.class);
- bind(PrerenderVisitorFactory.class);
+ // Install OptiModule, which explicitly binds classes in the opti package.
+ // We use a separate module rather than inlining the classes here to allow
+ // classes in the package to be package-private.
+ install(new OptiModule());
// Bind factories.
bind(EvalVisitorFactory.class).to(EvalVisitorFactoryImpl.class);
View
36 java/src/com/google/template/soy/sharedpasses/opti/OptiModule.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2011 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.template.soy.sharedpasses.opti;
+
+import com.google.inject.AbstractModule;
+
+/**
+ * Guice module for optimization passes.
+ *
+ * <p> Important: Do not use outside of Soy code (treat as superpackage-private).
+ *
+ * @author Anthony Jawad
+ */
+public class OptiModule extends AbstractModule {
+ @Override protected void configure() {
+ // Bindings for when explicit dependencies are required.
+ bind(PreevalVisitorFactory.class);
+ bind(PrerenderVisitorFactory.class);
+ bind(SimplifyExprVisitor.class);
+ bind(SimplifyVisitor.class);
+ }
+}
View
2  javadoc-complete/allclasses-frame.html
@@ -493,6 +493,8 @@
<BR>
<A HREF="com/google/template/soy/exprtree/OperatorNodes.TimesOpNode.html" title="class in com.google.template.soy.exprtree" target="classFrame">OperatorNodes.TimesOpNode</A>
<BR>
+<A HREF="com/google/template/soy/sharedpasses/opti/OptiModule.html" title="class in com.google.template.soy.sharedpasses.opti" target="classFrame">OptiModule</A>
+<BR>
<A HREF="com/google/template/soy/internal/base/Pair.html" title="class in com.google.template.soy.internal.base" target="classFrame">Pair</A>
<BR>
<A HREF="com/google/template/soy/basetree/ParentNode.html" title="interface in com.google.template.soy.basetree" target="classFrame"><I>ParentNode</I></A>
View
2  javadoc-complete/allclasses-noframe.html
@@ -493,6 +493,8 @@
<BR>
<A HREF="com/google/template/soy/exprtree/OperatorNodes.TimesOpNode.html" title="class in com.google.template.soy.exprtree">OperatorNodes.TimesOpNode</A>
<BR>
+<A HREF="com/google/template/soy/sharedpasses/opti/OptiModule.html" title="class in com.google.template.soy.sharedpasses.opti">OptiModule</A>
+<BR>
<A HREF="com/google/template/soy/internal/base/Pair.html" title="class in com.google.template.soy.internal.base">Pair</A>
<BR>
<A HREF="com/google/template/soy/basetree/ParentNode.html" title="interface in com.google.template.soy.basetree"><I>ParentNode</I></A>
View
287 javadoc-complete/com/google/template/soy/sharedpasses/opti/OptiModule.html
@@ -0,0 +1,287 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<!--NewPage-->
+<HTML>
+<HEAD>
+<TITLE>
+OptiModule (Soy Complete)
+</TITLE>
+
+
+<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">
+
+<SCRIPT type="text/javascript">
+function windowTitle()
+{
+ if (location.href.indexOf('is-external=true') == -1) {
+ parent.document.title="OptiModule (Soy Complete)";
+ }
+}
+</SCRIPT>
+<NOSCRIPT>
+</NOSCRIPT>
+
+</HEAD>
+
+<BODY BGCOLOR="white" onload="windowTitle();">
+<HR>
+
+
+<!-- ========= START OF TOP NAVBAR ======= -->
+<A NAME="navbar_top"><!-- --></A>
+<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
+<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
+<TR>
+<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
+<A NAME="navbar_top_firstrow"><!-- --></A>
+<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
+ <TR ALIGN="center" VALIGN="top">
+ <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
+ <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
+ <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
+ <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
+ <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
+ <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
+ <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
+ </TR>
+</TABLE>
+</TD>
+<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
+</EM>
+</TD>
+</TR>
+
+<TR>
+<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
+&nbsp;PREV CLASS&nbsp;
+&nbsp;<A HREF="../../../../../../com/google/template/soy/sharedpasses/opti/PreevalVisitorFactory.html" title="class in com.google.template.soy.sharedpasses.opti"><B>NEXT CLASS</B></A></FONT></TD>
+<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
+ <A HREF="../../../../../../index.html?com/google/template/soy/sharedpasses/opti/OptiModule.html" target="_top"><B>FRAMES</B></A> &nbsp;
+&nbsp;<A HREF="OptiModule.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
+&nbsp;<SCRIPT type="text/javascript">
+ <!--
+ if(window==top) {
+ document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
+ }
+ //-->
+</SCRIPT>
+<NOSCRIPT>
+ <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
+</NOSCRIPT>
+
+
+</FONT></TD>
+</TR>
+<TR>
+<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
+ SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
+<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
+DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
+</TR>
+</TABLE>
+<A NAME="skip-navbar_top"></A>
+<!-- ========= END OF TOP NAVBAR ========= -->
+
+<HR>
+<!-- ======== START OF CLASS DATA ======== -->
+<H2>
+<FONT SIZE="-1">
+com.google.template.soy.sharedpasses.opti</FONT>
+<BR>
+Class OptiModule</H2>
+<PRE>
+<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
+ <IMG SRC="../../../../../../resources/inherit.gif" ALT="extended by ">com.google.inject.AbstractModule
+ <IMG SRC="../../../../../../resources/inherit.gif" ALT="extended by "><B>com.google.template.soy.sharedpasses.opti.OptiModule</B>
+</PRE>
+<DL>
+<DT><B>All Implemented Interfaces:</B> <DD>com.google.inject.Module</DD>
+</DL>
+<HR>
+<DL>
+<DT><PRE>public class <B>OptiModule</B><DT>extends com.google.inject.AbstractModule</DL>
+</PRE>
+
+<P>
+Guice module for optimization passes.
+
+ <p> Important: Do not use outside of Soy code (treat as superpackage-private).
+<P>
+
+<P>
+<HR>
+
+<P>
+
+<!-- ======== CONSTRUCTOR SUMMARY ======== -->
+
+<A NAME="constructor_summary"><!-- --></A>
+<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
+<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
+<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
+<B>Constructor Summary</B></FONT></TH>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD><CODE><B><A HREF="../../../../../../com/google/template/soy/sharedpasses/opti/OptiModule.html#OptiModule()">OptiModule</A></B>()</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
+</TR>
+</TABLE>
+&nbsp;
+<!-- ========== METHOD SUMMARY =========== -->
+
+<A NAME="method_summary"><!-- --></A>
+<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
+<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
+<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
+<B>Method Summary</B></FONT></TH>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
+<CODE>protected &nbsp;void</CODE></FONT></TD>
+<TD><CODE><B><A HREF="../../../../../../com/google/template/soy/sharedpasses/opti/OptiModule.html#configure()">configure</A></B>()</CODE>
+
+<BR>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
+</TR>
+</TABLE>
+&nbsp;<A NAME="methods_inherited_from_class_com.google.inject.AbstractModule"><!-- --></A>
+<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
+<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
+<TH ALIGN="left"><B>Methods inherited from class com.google.inject.AbstractModule</B></TH>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD><CODE>addError, addError, addError, bind, bind, bind, bindConstant, binder, bindInterceptor, bindListener, bindScope, configure, convertToTypes, currentStage, getMembersInjector, getMembersInjector, getProvider, getProvider, install, requestInjection, requestStaticInjection, requireBinding, requireBinding</CODE></TD>
+</TR>
+</TABLE>
+&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
+<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
+<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
+<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
+</TR>
+</TABLE>
+&nbsp;
+<P>
+
+<!-- ========= CONSTRUCTOR DETAIL ======== -->
+
+<A NAME="constructor_detail"><!-- --></A>
+<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
+<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
+<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
+<B>Constructor Detail</B></FONT></TH>
+</TR>
+</TABLE>
+
+<A NAME="OptiModule()"><!-- --></A><H3>
+OptiModule</H3>
+<PRE>
+public <B>OptiModule</B>()</PRE>
+<DL>
+</DL>
+
+<!-- ============ METHOD DETAIL ========== -->
+
+<A NAME="method_detail"><!-- --></A>
+<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
+<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
+<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
+<B>Method Detail</B></FONT></TH>
+</TR>
+</TABLE>
+
+<A NAME="configure()"><!-- --></A><H3>
+configure</H3>
+<PRE>
+protected void <B>configure</B>()</PRE>
+<DL>
+<DD><DL>
+<DT><B>Specified by:</B><DD><CODE>configure</CODE> in class <CODE>com.google.inject.AbstractModule</CODE></DL>
+</DD>
+<DD><DL>
+</DL>
+</DD>
+</DL>
+<!-- ========= END OF CLASS DATA ========= -->
+<HR>
+
+
+<!-- ======= START OF BOTTOM NAVBAR ====== -->
+<A NAME="navbar_bottom"><!-- --></A>
+<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
+<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
+<TR>
+<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
+<A NAME="navbar_bottom_firstrow"><!-- --></A>
+<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
+ <TR ALIGN="center" VALIGN="top">
+ <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
+ <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
+ <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
+ <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
+ <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
+ <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
+ <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
+ </TR>
+</TABLE>
+</TD>
+<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
+</EM>
+</TD>
+</TR>
+
+<TR>
+<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
+&nbsp;PREV CLASS&nbsp;
+&nbsp;<A HREF="../../../../../../com/google/template/soy/sharedpasses/opti/PreevalVisitorFactory.html" title="class in com.google.template.soy.sharedpasses.opti"><B>NEXT CLASS</B></A></FONT></TD>
+<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
+ <A HREF="../../../../../../index.html?com/google/template/soy/sharedpasses/opti/OptiModule.html" target="_top"><B>FRAMES</B></A> &nbsp;
+&nbsp;<A HREF="OptiModule.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
+&nbsp;<SCRIPT type="text/javascript">
+ <!--
+ if(window==top) {
+ document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
+ }
+ //-->
+</SCRIPT>
+<NOSCRIPT>
+ <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
+</NOSCRIPT>
+
+
+</FONT></TD>
+</TR>
+<TR>
+<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
+ SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
+<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
+DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
+</TR>
+</TABLE>
+<A NAME="skip-navbar_bottom"></A>
+<!-- ======== END OF BOTTOM NAVBAR ======= -->
+
+<HR>
+
+
+ <div id="footer">
+ <div id="footerlogo" style="float:left">
+ <img src="http://www.google.com/images/art.gif"
+ alt="Google colored balls">
+ </div>
+ <div id="copyright" style="float:left">
+ <p>
+ &copy; 2009 Google -
+ <a href="http://www.google.com/privacy.html">Privacy Policy</a> -
+ <a href="http://www.google.com/terms_of_service.html">Terms and Conditions</a> -
+ <a href="http://www.google.com/about.html">About Google</a>
+ </p>
+ </div>
+ </div>
+
+
+</BODY>
+</HTML>
View
4 javadoc-complete/com/google/template/soy/sharedpasses/opti/PreevalVisitorFactory.html
@@ -52,7 +52,7 @@
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
-&nbsp;PREV CLASS&nbsp;
+&nbsp;<A HREF="../../../../../../com/google/template/soy/sharedpasses/opti/OptiModule.html" title="class in com.google.template.soy.sharedpasses.opti"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../../com/google/template/soy/sharedpasses/opti/PrerenderVisitorFactory.html" title="class in com.google.template.soy.sharedpasses.opti"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../index.html?com/google/template/soy/sharedpasses/opti/PreevalVisitorFactory.html" target="_top"><B>FRAMES</B></A> &nbsp;
@@ -264,7 +264,7 @@
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
-&nbsp;PREV CLASS&nbsp;
+&nbsp;<A HREF="../../../../../../com/google/template/soy/sharedpasses/opti/OptiModule.html" title="class in com.google.template.soy.sharedpasses.opti"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../../com/google/template/soy/sharedpasses/opti/PrerenderVisitorFactory.html" title="class in com.google.template.soy.sharedpasses.opti"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../index.html?com/google/template/soy/sharedpasses/opti/PreevalVisitorFactory.html" target="_top"><B>FRAMES</B></A> &nbsp;
View
2  javadoc-complete/com/google/template/soy/sharedpasses/opti/package-frame.html
@@ -21,6 +21,8 @@
Classes</FONT>&nbsp;
<FONT CLASS="FrameItemFont">
<BR>
+<A HREF="OptiModule.html" title="class in com.google.template.soy.sharedpasses.opti" target="classFrame">OptiModule</A>
+<BR>
<A HREF="PreevalVisitorFactory.html" title="class in com.google.template.soy.sharedpasses.opti" target="classFrame">PreevalVisitorFactory</A>
<BR>
<A HREF="PrerenderVisitorFactory.html" title="class in com.google.template.soy.sharedpasses.opti" target="classFrame">PrerenderVisitorFactory</A>
View
4 javadoc-complete/com/google/template/soy/sharedpasses/opti/package-summary.html
@@ -86,6 +86,10 @@
<B>Class Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD WIDTH="15%"><B><A HREF="../../../../../../com/google/template/soy/sharedpasses/opti/OptiModule.html" title="class in com.google.template.soy.sharedpasses.opti">OptiModule</A></B></TD>
+<TD>Guice module for optimization passes.</TD>
+</TR>
+<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../../../../com/google/template/soy/sharedpasses/opti/PreevalVisitorFactory.html" title="class in com.google.template.soy.sharedpasses.opti">PreevalVisitorFactory</A></B></TD>
<TD>A factory for creating PreevalVisitor objects.</TD>
</TR>
View
3  javadoc-complete/com/google/template/soy/sharedpasses/opti/package-tree.html
@@ -89,6 +89,9 @@
</H2>
<UL>
<LI TYPE="circle">java.lang.<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang"><B>Object</B></A><UL>
+<LI TYPE="circle">com.google.inject.AbstractModule (implements com.google.inject.Module)
+<UL>
+<LI TYPE="circle">com.google.template.soy.sharedpasses.opti.<A HREF="../../../../../../com/google/template/soy/sharedpasses/opti/OptiModule.html" title="class in com.google.template.soy.sharedpasses.opti"><B>OptiModule</B></A></UL>
<LI TYPE="circle">com.google.template.soy.basetree.<A HREF="../../../../../../com/google/template/soy/basetree/AbstractNodeVisitor.html" title="class in com.google.template.soy.basetree"><B>AbstractNodeVisitor</B></A>&lt;N,R&gt; (implements com.google.template.soy.basetree.<A HREF="../../../../../../com/google/template/soy/basetree/NodeVisitor.html" title="interface in com.google.template.soy.basetree">NodeVisitor</A>&lt;N,R&gt;)
<UL>
<LI TYPE="circle">com.google.template.soy.soytree.<A HREF="../../../../../../com/google/template/soy/soytree/AbstractSoyNodeVisitor.html" title="class in com.google.template.soy.soytree"><B>AbstractSoyNodeVisitor</B></A>&lt;R&gt;<UL>
View
6 javadoc-complete/index-all.html
@@ -1457,6 +1457,9 @@
<DT><A HREF="./com/google/template/soy/shared/internal/SharedModule.html#configure()"><B>configure()</B></A> -
Method in class com.google.template.soy.shared.internal.<A HREF="./com/google/template/soy/shared/internal/SharedModule.html" title="class in com.google.template.soy.shared.internal">SharedModule</A>
<DD>&nbsp;
+<DT><A HREF="./com/google/template/soy/sharedpasses/opti/OptiModule.html#configure()"><B>configure()</B></A> -
+Method in class com.google.template.soy.sharedpasses.opti.<A HREF="./com/google/template/soy/sharedpasses/opti/OptiModule.html" title="class in com.google.template.soy.sharedpasses.opti">OptiModule</A>
+<DD>&nbsp;
<DT><A HREF="./com/google/template/soy/sharedpasses/SharedPassesModule.html#configure()"><B>configure()</B></A> -
Method in class com.google.template.soy.sharedpasses.<A HREF="./com/google/template/soy/sharedpasses/SharedPassesModule.html" title="class in com.google.template.soy.sharedpasses">SharedPassesModule</A>
<DD>&nbsp;
@@ -5226,6 +5229,9 @@
<DT><A HREF="./com/google/template/soy/exprtree/OperatorNodes.TimesOpNode.html#OperatorNodes.TimesOpNode(com.google.template.soy.exprtree.OperatorNodes.TimesOpNode)"><B>OperatorNodes.TimesOpNode(OperatorNodes.TimesOpNode)</B></A> -
Constructor for class com.google.template.soy.exprtree.<A HREF="./com/google/template/soy/exprtree/OperatorNodes.TimesOpNode.html" title="class in com.google.template.soy.exprtree">OperatorNodes.TimesOpNode</A>
<DD>&nbsp;
+<DT><A HREF="./com/google/template/soy/sharedpasses/opti/OptiModule.html" title="class in com.google.template.soy.sharedpasses.opti"><B>OptiModule</B></A> - Class in <A HREF="./com/google/template/soy/sharedpasses/opti/package-summary.html">com.google.template.soy.sharedpasses.opti</A><DD>Guice module for optimization passes.<DT><A HREF="./com/google/template/soy/sharedpasses/opti/OptiModule.html#OptiModule()"><B>OptiModule()</B></A> -
+Constructor for class com.google.template.soy.sharedpasses.opti.<A HREF="./com/google/template/soy/sharedpasses/opti/OptiModule.html" title="class in com.google.template.soy.sharedpasses.opti">OptiModule</A>
+<DD>&nbsp;
<DT><A HREF="./com/google/template/soy/internal/i18n/BidiUtils.Dir.html#ord"><B>ord</B></A> -
Variable in enum com.google.template.soy.internal.i18n.<A HREF="./com/google/template/soy/internal/i18n/BidiUtils.Dir.html" title="enum in com.google.template.soy.internal.i18n">BidiUtils.Dir</A>
<DD>&nbsp;
View
2  javadoc-complete/overview-tree.html
@@ -90,7 +90,7 @@
<LI TYPE="circle">java.lang.<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang"><B>Object</B></A><UL>
<LI TYPE="circle">com.google.inject.AbstractModule (implements com.google.inject.Module)
<UL>
-<LI TYPE="circle">com.google.template.soy.basicdirectives.<A HREF="com/google/template/soy/basicdirectives/BasicDirectivesModule.html" title="class in com.google.template.soy.basicdirectives"><B>BasicDirectivesModule</B></A><LI TYPE="circle">com.google.template.soy.basicfunctions.<A HREF="com/google/template/soy/basicfunctions/BasicFunctionsModule.html" title="class in com.google.template.soy.basicfunctions"><B>BasicFunctionsModule</B></A><LI TYPE="circle">com.google.template.soy.bididirectives.<A HREF="com/google/template/soy/bididirectives/BidiDirectivesModule.html" title="class in com.google.template.soy.bididirectives"><B>BidiDirectivesModule</B></A><LI TYPE="circle">com.google.template.soy.bidifunctions.<A HREF="com/google/template/soy/bidifunctions/BidiFunctionsModule.html" title="class in com.google.template.soy.bidifunctions"><B>BidiFunctionsModule</B></A><LI TYPE="circle">com.google.template.soy.coredirectives.<A HREF="com/google/template/soy/coredirectives/CoreDirectivesModule.html" title="class in com.google.template.soy.coredirectives"><B>CoreDirectivesModule</B></A><LI TYPE="circle">com.google.template.soy.javasrc.internal.<A HREF="com/google/template/soy/javasrc/internal/JavaSrcModule.html" title="class in com.google.template.soy.javasrc.internal"><B>JavaSrcModule</B></A><LI TYPE="circle">com.google.template.soy.jssrc.internal.<A HREF="com/google/template/soy/jssrc/internal/JsSrcModule.html" title="class in com.google.template.soy.jssrc.internal"><B>JsSrcModule</B></A><LI TYPE="circle">com.google.template.soy.shared.internal.<A HREF="com/google/template/soy/shared/internal/SharedModule.html" title="class in com.google.template.soy.shared.internal"><B>SharedModule</B></A><LI TYPE="circle">com.google.template.soy.sharedpasses.<A HREF="com/google/template/soy/sharedpasses/SharedPassesModule.html" title="class in com.google.template.soy.sharedpasses"><B>SharedPassesModule</B></A><LI TYPE="circle">com.google.template.soy.<A HREF="com/google/template/soy/SoyModule.html" title="class in com.google.template.soy"><B>SoyModule</B></A><LI TYPE="circle">com.google.template.soy.tofu.internal.<A HREF="com/google/template/soy/tofu/internal/TofuModule.html" title="class in com.google.template.soy.tofu.internal"><B>TofuModule</B></A><LI TYPE="circle">com.google.template.soy.xliffmsgplugin.<A HREF="com/google/template/soy/xliffmsgplugin/XliffMsgPluginModule.html" title="class in com.google.template.soy.xliffmsgplugin"><B>XliffMsgPluginModule</B></A></UL>
+<LI TYPE="circle">com.google.template.soy.basicdirectives.<A HREF="com/google/template/soy/basicdirectives/BasicDirectivesModule.html" title="class in com.google.template.soy.basicdirectives"><B>BasicDirectivesModule</B></A><LI TYPE="circle">com.google.template.soy.basicfunctions.<A HREF="com/google/template/soy/basicfunctions/BasicFunctionsModule.html" title="class in com.google.template.soy.basicfunctions"><B>BasicFunctionsModule</B></A><LI TYPE="circle">com.google.template.soy.bididirectives.<A HREF="com/google/template/soy/bididirectives/BidiDirectivesModule.html" title="class in com.google.template.soy.bididirectives"><B>BidiDirectivesModule</B></A><LI TYPE="circle">com.google.template.soy.bidifunctions.<A HREF="com/google/template/soy/bidifunctions/BidiFunctionsModule.html" title="class in com.google.template.soy.bidifunctions"><B>BidiFunctionsModule</B></A><LI TYPE="circle">com.google.template.soy.coredirectives.<A HREF="com/google/template/soy/coredirectives/CoreDirectivesModule.html" title="class in com.google.template.soy.coredirectives"><B>CoreDirectivesModule</B></A><LI TYPE="circle">com.google.template.soy.javasrc.internal.<A HREF="com/google/template/soy/javasrc/internal/JavaSrcModule.html" title="class in com.google.template.soy.javasrc.internal"><B>JavaSrcModule</B></A><LI TYPE="circle">com.google.template.soy.jssrc.internal.<A HREF="com/google/template/soy/jssrc/internal/JsSrcModule.html" title="class in com.google.template.soy.jssrc.internal"><B>JsSrcModule</B></A><LI TYPE="circle">com.google.template.soy.sharedpasses.opti.<A HREF="com/google/template/soy/sharedpasses/opti/OptiModule.html" title="class in com.google.template.soy.sharedpasses.opti"><B>OptiModule</B></A><LI TYPE="circle">com.google.template.soy.shared.internal.<A HREF="com/google/template/soy/shared/internal/SharedModule.html" title="class in com.google.template.soy.shared.internal"><B>SharedModule</B></A><LI TYPE="circle">com.google.template.soy.sharedpasses.<A HREF="com/google/template/soy/sharedpasses/SharedPassesModule.html" title="class in com.google.template.soy.sharedpasses"><B>SharedPassesModule</B></A><LI TYPE="circle">com.google.template.soy.<A HREF="com/google/template/soy/SoyModule.html" title="class in com.google.template.soy"><B>SoyModule</B></A><LI TYPE="circle">com.google.template.soy.tofu.internal.<A HREF="com/google/template/soy/tofu/internal/TofuModule.html" title="class in com.google.template.soy.tofu.internal"><B>TofuModule</B></A><LI TYPE="circle">com.google.template.soy.xliffmsgplugin.<A HREF="com/google/template/soy/xliffmsgplugin/XliffMsgPluginModule.html" title="class in com.google.template.soy.xliffmsgplugin"><B>XliffMsgPluginModule</B></A></UL>
<LI TYPE="circle">com.google.template.soy.basetree.<A HREF="com/google/template/soy/basetree/AbstractNode.html" title="class in com.google.template.soy.basetree"><B>AbstractNode</B></A> (implements com.google.template.soy.basetree.<A HREF="com/google/template/soy/basetree/Node.html" title="interface in com.google.template.soy.basetree">Node</A>)
<UL>
<LI TYPE="circle">com.google.template.soy.exprtree.<A HREF="com/google/template/soy/exprtree/AbstractExprNode.html" title="class in com.google.template.soy.exprtree"><B>AbstractExprNode</B></A> (implements com.google.template.soy.exprtree.<A HREF="com/google/template/soy/exprtree/ExprNode.html" title="interface in com.google.template.soy.exprtree">ExprNode</A>)
View
135 javascript/soyutils.js
@@ -39,10 +39,8 @@
// COPIED FROM nogoog_shim.js
// Create closure namespaces.
-var goog;
-if (typeof goog == "undefined") {
- goog = {};
-}
+var goog = goog || {};
+
goog.inherits = function(childCtor, parentCtor) {
/** @constructor */
@@ -208,19 +206,6 @@ if (!goog.format) {
if (!goog.i18n) {
goog.i18n = {
- /**
- * Utility class for formatting text for display in a potentially
- * opposite-directionality context without garbling. Provides the following
- * functionality:
- *
- * @param {goog.i18n.bidi.Dir|number|boolean} contextDir The context
- * directionality as a number
- * (positive = LRT, negative = RTL, 0 = unknown).
- * @constructor
- */
- BidiFormatter: function (dir) {
- this.dir_ = dir;
- },
bidi: {
/**
* Check the directionality of a piece of text, return true if the piece
@@ -240,6 +225,54 @@ if (!goog.i18n) {
};
}
+/**
+ * Directionality enum.
+ * @enum {number}
+ */
+goog.i18n.bidi.Dir = {
+ RTL: -1,
+ UNKNOWN: 0,
+ LTR: 1
+};
+
+
+/**
+ * Convert a directionality given in various formats to a goog.i18n.bidi.Dir
+ * constant. Useful for interaction with different standards of directionality
+ * representation.
+ *
+ * @param {goog.i18n.bidi.Dir|number|boolean} givenDir Directionality given in
+ * one of the following formats:
+ * 1. A goog.i18n.bidi.Dir constant.
+ * 2. A number (positive = LRT, negative = RTL, 0 = unknown).
+ * 3. A boolean (true = RTL, false = LTR).
+ * @return {goog.i18n.bidi.Dir} A goog.i18n.bidi.Dir constant matching the given
+ * directionality.
+ */
+goog.i18n.bidi.toDir = function(givenDir) {
+ if (typeof givenDir == 'number') {
+ return givenDir > 0 ? goog.i18n.bidi.Dir.LTR :
+ givenDir < 0 ? goog.i18n.bidi.Dir.RTL : goog.i18n.bidi.Dir.UNKNOWN;
+ } else {
+ return givenDir ? goog.i18n.bidi.Dir.RTL : goog.i18n.bidi.Dir.LTR;
+ }
+};
+
+
+/**
+ * Utility class for formatting text for display in a potentially
+ * opposite-directionality context without garbling. Provides the following
+ * functionality:
+ *
+ * @param {goog.i18n.bidi.Dir|number|boolean} dir The context
+ * directionality as a number
+ * (positive = LRT, negative = RTL, 0 = unknown).
+ * @constructor
+ */
+goog.i18n.BidiFormatter = function(dir) {
+ this.dir_ = goog.i18n.bidi.toDir(dir);
+};
+
/**
* Returns "dir=ltr" or "dir=rtl", depending on {@code text}'s estimated
@@ -303,9 +336,11 @@ goog.i18n.BidiFormatter.prototype.markAfter = function (text, opt_isHtml) {
* garbled nor garbles what follows it.
*
* @param {string} str The input text.
+ * @param {boolean=} placeholder This argument exists for consistency with the
+ * Closure Library. Specifying it has no effect.
* @return {string} Input text after applying the above processing.
*/
-goog.i18n.BidiFormatter.prototype.spanWrap = function(str) {
+goog.i18n.BidiFormatter.prototype.spanWrap = function(str, placeholder) {
str = String(str);
var textDir = soy.$$bidiTextDir(str, true);
var reset = soyshim.$$bidiMarkAfterKnownDir_(this.dir_, textDir, str, true);
@@ -335,9 +370,11 @@ goog.i18n.BidiFormatter.prototype.startEdge = function () {
* allow mark-up, e.g. an 'option' tag.
*
* @param {string} str The input text.
+ * @param {boolean=} placeholder This argument exists for consistency with the
+ * Closure Library. Specifying it has no effect.
* @return {string} Input text after applying the above processing.
*/
-goog.i18n.BidiFormatter.prototype.unicodeWrap = function(str) {
+goog.i18n.BidiFormatter.prototype.unicodeWrap = function(str, placeholder) {
str = String(str);
var textDir = soy.$$bidiTextDir(str, true);
var reset = soyshim.$$bidiMarkAfterKnownDir_(this.dir_, textDir, str, true);
@@ -351,36 +388,14 @@ goog.i18n.BidiFormatter.prototype.unicodeWrap = function(str) {
goog.string = {
- /**
- * Utility class to facilitate much faster string concatenation in IE,
- * using Array.join() rather than the '+' operator. For other browsers
- * we simply use the '+' operator.
- *
- * @param {Object|number|string|boolean=} opt_a1 Optional first initial item
- * to append.
- * @param {...Object|number|string|boolean} var_args Other initial items to
- * append, e.g., new goog.string.StringBuffer('foo', 'bar').
- * @constructor
- */
- StringBuffer: function(opt_a1, var_args) {
-
- /**
- * Internal buffer for the string to be concatenated.
- * @type {string|Array}
- * @private
- */
- this.buffer_ = goog.userAgent.HAS_JSCRIPT ? [] : '';
- if (opt_a1 != null) {
- this.append.apply(this, arguments);
- }
- },
/**
* Converts \r\n, \r, and \n to <br>s
* @param {*} str The string in which to convert newlines.
+ * @param {boolean=} opt_xml Whether to use XML compatible tags.
* @return {string} A copy of {@code str} with converted newlines.
*/
- newlineToBr: function(str) {
+ newLineToBr: function(str, opt_xml) {
str = String(str);
@@ -390,7 +405,7 @@ goog.string = {
return str;
}
- return str.replace(/(\r\n|\r|\n)/g, '<br>');
+ return str.replace(/(\r\n|\r|\n)/g, opt_xml ? '<br />' : '<br>');
},
urlEncode: encodeURIComponent,
/**
@@ -398,7 +413,32 @@ goog.string = {
* @type {RegExp}
* @private
*/
- NEWLINE_TO_BR_RE: /[\r\n]/
+ NEWLINE_TO_BR_RE_: /[\r\n]/
+};
+
+
+/**
+ * Utility class to facilitate much faster string concatenation in IE,
+ * using Array.join() rather than the '+' operator. For other browsers
+ * we simply use the '+' operator.
+ *
+ * @param {Object|number|string|boolean=} opt_a1 Optional first initial item
+ * to append.
+ * @param {...Object|number|string|boolean} var_args Other initial items to
+ * append, e.g., new goog.string.StringBuffer('foo', 'bar').
+ * @constructor
+ */
+goog.string.StringBuffer = function(opt_a1, var_args) {
+ /**
+ * Internal buffer for the string to be concatenated.
+ * @type {string|Array}
+ * @private
+ */
+ this.buffer_ = goog.userAgent.HAS_JSCRIPT ? [] : '';
+
+ if (opt_a1 != null) {
+ this.append.apply(this, arguments);
+ }
};
@@ -495,10 +535,11 @@ if (!goog.soy) goog.soy = {
* innerHTML in your hand-written code, so that it will be easier
* to audit the code for cross-site scripting vulnerabilities.
*
- * @param {Element} element The element whose content we are rendering.
* @param {Function} template The Soy template defining element's content.
* @param {Object=} opt_templateData The data for the template.
* @param {Object=} opt_injectedData The injected data for the template.
+ * @param {Document=} opt_document The document used to create DOM nodes. If
+ * not specified, global document object is used.
*/
renderAsElement: function(
template, opt_templateData, opt_injectedData, opt_document) {
@@ -548,7 +589,7 @@ if (!goog.soy) goog.soy = {
var soy = { esc: {} };
var soydata = {};
-var soyshim = {};
+var soyshim = { $$DEFAULT_TEMPLATE_DATA_: {} };
/**
* Helper function to render a Soy template into a single node or a document
* fragment. If the rendered HTML string represents a single node, then that
Please sign in to comment.
Something went wrong with that request. Please try again.