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 |
5 // 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 |
6 // 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. |
7 | 9 |
8 // 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 |
9 // reservedNativeProperties. In general we don't check arbitrary | 11 // reservedNativeProperties. In general we don't check arbitrary |
10 // names for clashes because it's hard - subclasses can force superclasses | 12 // names for clashes because it's hard - subclasses can force superclasses |
11 // 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 |
12 // 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. |
13 class A native "*A" { | 15 class A native "*A" { |
14 int bar; | 16 int bar; |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 Expect.equals(42, foo.send); | 79 Expect.equals(42, foo.send); |
78 Expect.equals(271, foo.bar = 271); | 80 Expect.equals(271, foo.bar = 271); |
79 Expect.equals(271, foo.g = 271); | 81 Expect.equals(271, foo.g = 271); |
80 Expect.equals(271, foo.s = 271); | 82 Expect.equals(271, foo.s = 271); |
81 Expect.equals(271, foo.end = 271); | 83 Expect.equals(271, foo.end = 271); |
82 Expect.equals(271, foo.gend = 271); | 84 Expect.equals(271, foo.gend = 271); |
83 Expect.equals(271, foo.send = 271); | 85 Expect.equals(271, foo.send = 271); |
84 Expect.equals(6, foo.gettersCalled); | 86 Expect.equals(6, foo.gettersCalled); |
85 Expect.equals(6, foo.settersCalled); | 87 Expect.equals(6, foo.settersCalled); |
86 } | 88 } |
87 | |
OLD | NEW |