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

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

Issue 1153003003: fixes #40, extension methods for primitive types (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 6 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
Index: lib/src/js/nodes.dart
diff --git a/lib/src/js/nodes.dart b/lib/src/js/nodes.dart
index 2b62fea9c2399c2511a7fb4e4529dd1fb6b2a0e4..6c44d55748b406ed24c3e868842e7375de3b53f0 100644
--- a/lib/src/js/nodes.dart
+++ b/lib/src/js/nodes.dart
@@ -1083,8 +1083,9 @@ class LiteralNumber extends Literal {
class ArrayInitializer extends Expression {
final List<Expression> elements;
+ final bool multiline;
- ArrayInitializer(this.elements);
+ ArrayInitializer(this.elements, {this.multiline: false});
accept(NodeVisitor visitor) => visitor.visitArrayInitializer(this);
@@ -1113,20 +1114,13 @@ class ArrayHole extends Expression {
class ObjectInitializer extends Expression {
final List<Property> properties;
- /**
- * If set to true, forces a vertical layout when using the [Printer].
- * Otherwise, layout will be vertical if and only if any [properties]
- * are [FunctionExpression]s.
- */
- final bool _vertical;
- bool get vertical {
- return _vertical || properties.any((p) => p.value is FunctionExpression);
- }
+ final bool _multiline;
/**
* Constructs a new object-initializer containing the given [properties].
*/
- ObjectInitializer(this.properties, {vertical: false}) : _vertical = vertical;
+ ObjectInitializer(this.properties, {multiline: false})
+ : _multiline = multiline;
accept(NodeVisitor visitor) => visitor.visitObjectInitializer(this);
@@ -1137,6 +1131,14 @@ class ObjectInitializer extends Expression {
ObjectInitializer _clone() => new ObjectInitializer(properties);
int get precedenceLevel => PRIMARY;
+ /**
+ * If set to true, forces a vertical layout when using the [Printer].
+ * Otherwise, layout will be vertical if and only if any [properties]
+ * are [FunctionExpression]s.
+ */
+ bool get multiline {
+ return _multiline || properties.any((p) => p.value is FunctionExpression);
+ }
}
class Property extends Node {

Powered by Google App Engine
This is Rietveld 408576698