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 methods are not renamed to clash with native field names | 7 // Verify that methods are not renamed to clash with native field names |
8 // that are known from the DOM (like x, y, z). | 8 // that are known from the DOM (like x, y, z). |
9 @Native("A") | 9 @Native("A") |
10 class A { | 10 class A { |
(...skipping 17 matching lines...) Expand all Loading... |
28 z: { get: getter, configurable: false, writeable: false } | 28 z: { get: getter, configurable: false, writeable: false } |
29 }); | 29 }); |
30 a.gettersCalled = 0; | 30 a.gettersCalled = 0; |
31 return a; | 31 return a; |
32 } | 32 } |
33 | 33 |
34 makeA = function() { return new A; }; | 34 makeA = function() { return new A; }; |
35 self.nativeConstructor(A); | 35 self.nativeConstructor(A); |
36 """; | 36 """; |
37 | 37 |
38 A makeA() native ; | 38 A makeA() native; |
39 | 39 |
40 class B { | 40 class B { |
41 void a() {} | 41 void a() {} |
42 void a0() {} | 42 void a0() {} |
43 void a1() {} | 43 void a1() {} |
44 void a2() {} | 44 void a2() {} |
45 void a3() {} | 45 void a3() {} |
46 void a4() {} | 46 void a4() {} |
47 void a5() {} | 47 void a5() {} |
48 void a6() {} | 48 void a6() {} |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 try { | 161 try { |
162 x.a25(); | 162 x.a25(); |
163 } catch (e) {} | 163 } catch (e) {} |
164 try { | 164 try { |
165 x.a26(); | 165 x.a26(); |
166 } catch (e) {} | 166 } catch (e) {} |
167 Expect.equals(0, x.gettersCalled); | 167 Expect.equals(0, x.gettersCalled); |
168 Expect.equals(42, x.z); | 168 Expect.equals(42, x.z); |
169 Expect.equals(1, x.gettersCalled); | 169 Expect.equals(1, x.gettersCalled); |
170 } | 170 } |
OLD | NEW |