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 "native_testing.dart"; | 5 import "native_testing.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 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 }); | 54 }); |
55 a.gettersCalled = 0; | 55 a.gettersCalled = 0; |
56 a.settersCalled = 0; | 56 a.settersCalled = 0; |
57 return a; | 57 return a; |
58 } | 58 } |
59 | 59 |
60 makeA = function() { return new A; }; | 60 makeA = function() { return new A; }; |
61 self.nativeConstructor(A); | 61 self.nativeConstructor(A); |
62 """; | 62 """; |
63 | 63 |
64 A makeA() native ; | 64 A makeA() native; |
65 | 65 |
66 class B {} | 66 class B {} |
67 | 67 |
68 main() { | 68 main() { |
69 nativeTesting(); | 69 nativeTesting(); |
70 setup(); | 70 setup(); |
71 confuse(new B()); | 71 confuse(new B()); |
72 var a = makeA(); | 72 var a = makeA(); |
73 | 73 |
74 Expect.equals(42, confuse(a).bar); | 74 Expect.equals(42, confuse(a).bar); |
(...skipping 19 matching lines...) Expand all Loading... |
94 Expect.equals(42, a.send); | 94 Expect.equals(42, a.send); |
95 Expect.equals(271, a.bar = 271); | 95 Expect.equals(271, a.bar = 271); |
96 Expect.equals(271, a.g = 271); | 96 Expect.equals(271, a.g = 271); |
97 Expect.equals(271, a.s = 271); | 97 Expect.equals(271, a.s = 271); |
98 Expect.equals(271, a.end = 271); | 98 Expect.equals(271, a.end = 271); |
99 Expect.equals(271, a.gend = 271); | 99 Expect.equals(271, a.gend = 271); |
100 Expect.equals(271, a.send = 271); | 100 Expect.equals(271, a.send = 271); |
101 Expect.equals(12, a.gettersCalled); | 101 Expect.equals(12, a.gettersCalled); |
102 Expect.equals(12, a.settersCalled); | 102 Expect.equals(12, a.settersCalled); |
103 } | 103 } |
OLD | NEW |