Reviewers: johnlenz,

Description:
Fix Closure backend with JsNumericEntry


Please review this at http://gwt-code-reviews.appspot.com/1640803/

Affected files:
  M dev/core/src/com/google/gwt/dev/js/ClosureJsAstTranslator.java


Index: dev/core/src/com/google/gwt/dev/js/ClosureJsAstTranslator.java
===================================================================
--- dev/core/src/com/google/gwt/dev/js/ClosureJsAstTranslator.java (revision 7614) +++ dev/core/src/com/google/gwt/dev/js/ClosureJsAstTranslator.java (working copy)
@@ -46,6 +46,7 @@
 import com.google.gwt.dev.js.ast.JsNode;
 import com.google.gwt.dev.js.ast.JsNullLiteral;
 import com.google.gwt.dev.js.ast.JsNumberLiteral;
+import com.google.gwt.dev.js.ast.JsNumericEntry;
 import com.google.gwt.dev.js.ast.JsObjectLiteral;
 import com.google.gwt.dev.js.ast.JsParameter;
 import com.google.gwt.dev.js.ast.JsPostfixOperation;
@@ -83,7 +84,7 @@
 import java.util.Set;

 /**
- * Translate a Dart JS AST to a Closure Compiler AST.
+ * Translate a GWT JS AST to a Closure Compiler AST.
  */
 public class ClosureJsAstTranslator {
   private static String getStringValue(double value) {
@@ -420,6 +421,9 @@
       case NULL:
         return transform((JsNullLiteral) x);
       case NUMBER:
+        if (x instanceof JsNumericEntry) {
+          return transform((JsNumericEntry) x);
+        }
         return transform((JsNumberLiteral) x);
       case REGEXP:
         return transform((JsRegExp) x);
@@ -599,6 +603,10 @@
     return IR.nullNode();
   }

+  private Node transform(JsNumericEntry x) {
+    return IR.number(x.getValue());
+  }
+
   private Node transform(JsNumberLiteral x) {
     return IR.number(x.getValue());
   }


--
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to