| 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"; | 5 import "package:expect/expect.dart"; |
| 6 | 6 |
| 7 // Verify that we can have fields with names that start with g and s even | 7 // Verify that we can have fields with names that start with g and s even |
| 8 // though those names are reserved for getters and setters in minified mode. | 8 // though those names are reserved for getters and setters in minified mode. |
| 9 | 9 |
| 10 // Note: this works because end and send are both in the list of | 10 // Note: this works because end and send are both in the list of |
| 11 // reservedNativeProperties. In general we don't check arbitrary | 11 // reservedNativeProperties. In general we don't check arbitrary |
| 12 // names for clashes because it's hard - subclasses can force superclasses | 12 // names for clashes because it's hard - subclasses can force superclasses |
| 13 // to rename getters, and that can force unrelated classes to change their | 13 // to rename getters, and that can force unrelated classes to change their |
| 14 // getters too if they have a property that has the same name. | 14 // getters too if they have a property that has the same name. |
| 15 class A native "*A" { | 15 class A native "A" { |
| 16 int bar; | 16 int bar; |
| 17 int g; | 17 int g; |
| 18 int s; | 18 int s; |
| 19 int end; | 19 int end; |
| 20 int gend; | 20 int gend; |
| 21 int send; | 21 int send; |
| 22 int gettersCalled; | 22 int gettersCalled; |
| 23 int settersCalled; | 23 int settersCalled; |
| 24 } | 24 } |
| 25 | 25 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 Expect.equals(42, foo.send); | 79 Expect.equals(42, foo.send); |
| 80 Expect.equals(271, foo.bar = 271); | 80 Expect.equals(271, foo.bar = 271); |
| 81 Expect.equals(271, foo.g = 271); | 81 Expect.equals(271, foo.g = 271); |
| 82 Expect.equals(271, foo.s = 271); | 82 Expect.equals(271, foo.s = 271); |
| 83 Expect.equals(271, foo.end = 271); | 83 Expect.equals(271, foo.end = 271); |
| 84 Expect.equals(271, foo.gend = 271); | 84 Expect.equals(271, foo.gend = 271); |
| 85 Expect.equals(271, foo.send = 271); | 85 Expect.equals(271, foo.send = 271); |
| 86 Expect.equals(6, foo.gettersCalled); | 86 Expect.equals(6, foo.gettersCalled); |
| 87 Expect.equals(6, foo.settersCalled); | 87 Expect.equals(6, foo.settersCalled); |
| 88 } | 88 } |
| OLD | NEW |