Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(878)

Unified Diff: lib/src/js/nodes.dart

Issue 1090613006: fix #155, numeric integer literals (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/codegen/expect/misc.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/js/nodes.dart
diff --git a/lib/src/js/nodes.dart b/lib/src/js/nodes.dart
index 808ff3cdbf7a9447ca1b9454512f78a1ee621b57..ac6f7cd134a7c678d4e1aa3e5349f6b1d7e10a1e 100644
--- a/lib/src/js/nodes.dart
+++ b/lib/src/js/nodes.dart
@@ -1091,6 +1091,12 @@ class LiteralNumber extends Literal {
accept(NodeVisitor visitor) => visitor.visitLiteralNumber(this);
LiteralNumber _clone() => new LiteralNumber(value);
+
+ /**
+ * Make sure to generate `(1).toString()` and `1.0.toString()`. In other
Jacob 2015/04/23 20:18:54 comment text is a bit awkward. Instead of "Make su
Jennifer Messerly 2015/04/23 20:38:51 Done.
+ * words, we pretend to have a difference precedence if a dot is present
+ */
+ int get precedenceLevel => value.contains('.') ? PRIMARY : UNARY;
}
class ArrayInitializer extends Expression {
« no previous file with comments | « no previous file | test/codegen/expect/misc.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698