| Index: sdk/lib/_internal/compiler/implementation/js/printer.dart
|
| diff --git a/sdk/lib/_internal/compiler/implementation/js/printer.dart b/sdk/lib/_internal/compiler/implementation/js/printer.dart
|
| index 1cf97a3e180362ebf70e2e757a800bb55d6bb95a..bc29bfedfde91fc776ff8e25195d3a2b21dbd281 100644
|
| --- a/sdk/lib/_internal/compiler/implementation/js/printer.dart
|
| +++ b/sdk/lib/_internal/compiler/implementation/js/printer.dart
|
| @@ -802,25 +802,26 @@ class Printer implements NodeVisitor {
|
| // Print all the properties on one line until we see a function-valued
|
| // property. Ideally, we would use a proper pretty-printer to make the
|
| // decision based on layout.
|
| - bool onePerLine = false;
|
| List<Property> properties = node.properties;
|
| out("{");
|
| ++indentLevel;
|
| for (int i = 0; i < properties.length; i++) {
|
| Expression value = properties[i].value;
|
| - if (value is Fun || value is NamedFunction) onePerLine = true;
|
| if (i != 0) {
|
| out(",");
|
| - if (!onePerLine) spaceOut();
|
| + if (node.isOneLiner) spaceOut();
|
| }
|
| - if (onePerLine) {
|
| + if (!node.isOneLiner) {
|
| forceLine();
|
| indent();
|
| }
|
| visitProperty(properties[i]);
|
| }
|
| --indentLevel;
|
| - if (onePerLine) lineOut();
|
| + if (!node.isOneLiner && !properties.isEmpty) {
|
| + lineOut();
|
| + indent();
|
| + }
|
| out("}");
|
| }
|
|
|
|
|