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 abstract class has same name. | 5 // Test for correct hidden native class when abstract class has same name. |
6 | 6 |
7 library main; | 7 library main; |
8 | 8 |
9 import 'native_testing.dart'; | 9 import 'native_testing.dart'; |
10 import 'native_library_same_name_used_lib1.dart'; | 10 import 'native_library_same_name_used_lib1.dart'; |
11 | 11 |
12 void setup() native """ | 12 void setup() native """ |
13 // This code is all inside 'setup' and so not accesible from the global scope. | 13 // This code is all inside 'setup' and so not accessible from the global scope
. |
14 function I(){} | 14 function I(){} |
15 I.prototype.read = function() { return this._x; }; | 15 I.prototype.read = function() { return this._x; }; |
16 I.prototype.write = function(x) { this._x = x; }; | 16 I.prototype.write = function(x) { this._x = x; }; |
17 makeI = function(){return new I}; | 17 makeI = function(){return new I}; |
18 self.nativeConstructor(I); | 18 self.nativeConstructor(I); |
19 """; | 19 """; |
20 | 20 |
21 // A pure Dart implementation of I. | 21 // A pure Dart implementation of I. |
22 | 22 |
23 class ProxyI implements I { | 23 class ProxyI implements I { |
(...skipping 22 matching lines...) Expand all Loading... |
46 | 46 |
47 Expect.isTrue(b1 is I, 'b1 is I'); | 47 Expect.isTrue(b1 is I, 'b1 is I'); |
48 Expect.isTrue(b1 is ProxyI, 'b1 is ProxyI'); | 48 Expect.isTrue(b1 is ProxyI, 'b1 is ProxyI'); |
49 | 49 |
50 Expect.isTrue(a1 is I, 'a1 is I'); | 50 Expect.isTrue(a1 is I, 'a1 is I'); |
51 Expect.isFalse(a1 is ProxyI, 'a1 is ProxyI'); | 51 Expect.isFalse(a1 is ProxyI, 'a1 is ProxyI'); |
52 | 52 |
53 Expect.isTrue(confuse(a1) is I, 'a1 is I'); | 53 Expect.isTrue(confuse(a1) is I, 'a1 is I'); |
54 Expect.isFalse(confuse(a1) is ProxyI, 'a1 is ProxyI'); | 54 Expect.isFalse(confuse(a1) is ProxyI, 'a1 is ProxyI'); |
55 } | 55 } |
OLD | NEW |