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 for correct hidden native class when interface has same name. | 5 // Test for correct hidden native class when interface has same name. |
6 | 6 |
7 library main; | 7 library main; |
| 8 import "package:expect/expect.dart"; |
8 import 'native_library_same_name_used_lib1.dart'; | 9 import 'native_library_same_name_used_lib1.dart'; |
9 import 'native_metadata.dart'; | 10 import 'native_metadata.dart'; |
10 | 11 |
11 @Native(""" | 12 @Native(""" |
12 // This code is all inside 'setup' and so not accesible from the global scope. | 13 // This code is all inside 'setup' and so not accesible from the global scope. |
13 function I(){} | 14 function I(){} |
14 I.prototype.read = function() { return this._x; }; | 15 I.prototype.read = function() { return this._x; }; |
15 I.prototype.write = function(x) { this._x = x; }; | 16 I.prototype.write = function(x) { this._x = x; }; |
16 makeI = function(){return new I}; | 17 makeI = function(){return new I}; |
17 """) | 18 """) |
(...skipping 18 matching lines...) Expand all Loading... |
36 | 37 |
37 Expect.isFalse(ob is I, 'ob is I'); | 38 Expect.isFalse(ob is I, 'ob is I'); |
38 Expect.isFalse(ob is ProxyI, 'ob is ProxyI'); | 39 Expect.isFalse(ob is ProxyI, 'ob is ProxyI'); |
39 | 40 |
40 Expect.isTrue(b1 is I, 'b1 is I'); | 41 Expect.isTrue(b1 is I, 'b1 is I'); |
41 Expect.isTrue(b1 is ProxyI, 'b1 is ProxyI'); | 42 Expect.isTrue(b1 is ProxyI, 'b1 is ProxyI'); |
42 | 43 |
43 Expect.isTrue(a1 is I, 'a1 is I'); | 44 Expect.isTrue(a1 is I, 'a1 is I'); |
44 Expect.isFalse(a1 is ProxyI, 'a1 is ProxyI'); | 45 Expect.isFalse(a1 is ProxyI, 'a1 is ProxyI'); |
45 } | 46 } |
OLD | NEW |