| 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 // Test to see if resolving a hidden native class's method interferes with | 5 // Test to see if resolving a hidden native class's method interferes with |
| 6 // subsequent resolving the subclass's method. This might happen if the | 6 // subsequent resolving the subclass's method. This might happen if the |
| 7 // superclass caches the method in the prototype, so shadowing the dispatcher | 7 // superclass caches the method in the prototype, so shadowing the dispatcher |
| 8 // stored on Object.prototype. | 8 // stored on Object.prototype. |
| 9 | 9 |
| 10 import "package:expect/expect.dart"; | |
| 11 import 'native_metadata.dart'; | 10 import 'native_metadata.dart'; |
| 12 | 11 |
| 13 @Native("*A") | 12 @Native("*A") |
| 14 class A { | 13 class A { |
| 15 @native foo([a=100]); | 14 @native foo([a=100]); |
| 16 } | 15 } |
| 17 | 16 |
| 18 @Native("*B") | 17 @Native("*B") |
| 19 class B extends A { | 18 class B extends A { |
| 20 } | 19 } |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 Expect.equals('C.foo(300)', d.foo()); | 76 Expect.equals('C.foo(300)', d.foo()); |
| 78 // If the above line fails with C.foo(100) then the dispatch to fill in the | 77 // If the above line fails with C.foo(100) then the dispatch to fill in the |
| 79 // default got the wrong one, followed by a second dispatch that resolved to | 78 // default got the wrong one, followed by a second dispatch that resolved to |
| 80 // the correct native method. | 79 // the correct native method. |
| 81 | 80 |
| 82 Expect.equals('A.foo(1)', a.foo(1)); | 81 Expect.equals('A.foo(1)', a.foo(1)); |
| 83 Expect.equals('A.foo(2)', b.foo(2)); | 82 Expect.equals('A.foo(2)', b.foo(2)); |
| 84 Expect.equals('C.foo(3)', c.foo(3)); | 83 Expect.equals('C.foo(3)', c.foo(3)); |
| 85 Expect.equals('C.foo(4)', d.foo(4)); | 84 Expect.equals('C.foo(4)', d.foo(4)); |
| 86 } | 85 } |
| OLD | NEW |