Index: pkg/js_ast/lib/src/nodes.dart |
diff --git a/pkg/js_ast/lib/src/nodes.dart b/pkg/js_ast/lib/src/nodes.dart |
index 95c8819f1c88e971b501c6685c347c74398fdfba..b6d11aa9988096635af8327233c25e91f0540cf7 100644 |
--- a/pkg/js_ast/lib/src/nodes.dart |
+++ b/pkg/js_ast/lib/src/nodes.dart |
@@ -985,7 +985,7 @@ abstract class DeferredNumber extends DeferredToken implements Literal { |
int get value; |
- int get precedenceLevel => PRIMARY; |
+ int get precedenceLevel => value.isNegative ? UNARY : PRIMARY; |
} |
/// Interace for a deferred string value. An implementation has to provide |
@@ -1074,6 +1074,8 @@ class LiteralNumber extends Literal { |
LiteralNumber(this.value); |
+ int get precedenceLevel => value.startsWith('-') ? UNARY : PRIMARY; |
+ |
accept(NodeVisitor visitor) => visitor.visitLiteralNumber(this); |
LiteralNumber _clone() => new LiteralNumber(value); |
} |