| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 import "package:expect/expect.dart"; | |
| 6 | |
| 7 | 5 |
| 8 class A { | 6 class A { |
| 9 int value; | 7 int value; |
| 10 A(this.value); | 8 A(this.value); |
| 11 void set(int value) { this.value = value; } | 9 void set(int value) { this.value = value; } |
| 12 int get() => value; | 10 int get() => value; |
| 13 int operator[](int index) => value + index; | 11 int operator[](int index) => value + index; |
| 14 void operator[]=(int index, int newValue) { value += -index + newValue; } | 12 void operator[]=(int index, int newValue) { value += -index + newValue; } |
| 15 void test(int expected) { | 13 void test(int expected) { |
| 16 Expect.equals(expected, value); | 14 Expect.equals(expected, value); |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 // Should parse as: | 128 // Should parse as: |
| 131 // box = (box..x = (a.value == 21 ? b : c)..x.test(117)); | 129 // box = (box..x = (a.value == 21 ? b : c)..x.test(117)); |
| 132 box = box..x = a.value == 21 ? b : c..x.test(117); | 130 box = box..x = a.value == 21 ? b : c..x.test(117); |
| 133 Expect.equals(originalBox, box); | 131 Expect.equals(originalBox, box); |
| 134 Expect.equals(box.value, b); | 132 Expect.equals(box.value, b); |
| 135 | 133 |
| 136 // New cascades are allowed inside an expressionWithoutCascade if properly | 134 // New cascades are allowed inside an expressionWithoutCascade if properly |
| 137 // delimited. | 135 // delimited. |
| 138 box..x = (a..set(42)..test(42))..x.test(42); | 136 box..x = (a..set(42)..test(42))..x.test(42); |
| 139 } | 137 } |
| OLD | NEW |