Fix Closure backend with JsNumericEntry Review at http://gwt-code-reviews.appspot.com/1640803 Review by: johnlenz@google.com git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@10878 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/dev/core/src/com/google/gwt/dev/js/ClosureJsAstTranslator.java b/dev/core/src/com/google/gwt/dev/js/ClosureJsAstTranslator.java index 54d1c46..c0d8f40 100644 --- a/dev/core/src/com/google/gwt/dev/js/ClosureJsAstTranslator.java +++ b/dev/core/src/com/google/gwt/dev/js/ClosureJsAstTranslator.java
@@ -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()); }