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

Unified Diff: sdk/lib/_internal/compiler/implementation/js/nodes.dart

Issue 80053004: Nicer pretty printing of jsAst object literals. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated tests Created 7 years, 1 month 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 | sdk/lib/_internal/compiler/implementation/js/printer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/js/nodes.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js/nodes.dart b/sdk/lib/_internal/compiler/implementation/js/nodes.dart
index 5335faec6d74f3d6152411ad8c4c92ed57ed1f37..afc27dec1cdf8bc4dd560d9748bb45814538936e 100644
--- a/sdk/lib/_internal/compiler/implementation/js/nodes.dart
+++ b/sdk/lib/_internal/compiler/implementation/js/nodes.dart
@@ -925,8 +925,16 @@ class ArrayElement extends Node {
class ObjectInitializer extends Expression {
List<Property> properties;
+ bool isOneLiner;
- ObjectInitializer(this.properties);
+ /**
+ * Constructs a new object-initializer containing the given [properties].
+ *
+ * [isOneLiner] describes the behaviour when pretty-printing (non-minified).
+ * If true print all properties on the same line.
+ * If false print each property on a seperate line.
+ */
+ ObjectInitializer(this.properties, {this.isOneLiner: true});
accept(NodeVisitor visitor) => visitor.visitObjectInitializer(this);
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/js/printer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698