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 | 5 |
6 library library10.dart; | 6 library library10.dart; |
7 | 7 |
8 import "library11.dart" as lib11; | 8 import "library11.dart" as lib11; |
9 import "package:expect/expect.dart"; | 9 import "package:expect/expect.dart"; |
10 | 10 |
11 class Library10 { | 11 class Library10 { |
12 Library10(this.fld); | 12 Library10(this.fld); |
13 func() { | 13 func() { |
14 return 2; | 14 return 2; |
15 } | 15 } |
| 16 |
16 var fld; | 17 var fld; |
17 static static_func() { | 18 static static_func() { |
18 var result = 0; | 19 var result = 0; |
19 var obj = new lib11.Library11(4); | 20 var obj = new lib11.Library11(4); |
20 result = obj.fld; | 21 result = obj.fld; |
21 Expect.equals(4, result); | 22 Expect.equals(4, result); |
22 result += obj.func(); | 23 result += obj.func(); |
23 Expect.equals(7, result); | 24 Expect.equals(7, result); |
24 result += lib11.Library11.static_func(); | 25 result += lib11.Library11.static_func(); |
25 Expect.equals(9, result); | 26 Expect.equals(9, result); |
26 result += lib11.Library11.static_fld; | 27 result += lib11.Library11.static_fld; |
27 Expect.equals(10, result); | 28 Expect.equals(10, result); |
28 Expect.equals(100, lib11.top_level11); | 29 Expect.equals(100, lib11.top_level11); |
29 Expect.equals(200, lib11.top_level_func11()); | 30 Expect.equals(200, lib11.top_level_func11()); |
30 return 3; | 31 return 3; |
31 } | 32 } |
| 33 |
32 static var static_fld = 4; | 34 static var static_fld = 4; |
33 } | 35 } |
34 | 36 |
35 const int top_level10 = 10; | 37 const int top_level10 = 10; |
36 top_level_func10() { | 38 top_level_func10() { |
37 return 20; | 39 return 20; |
38 } | 40 } |
OLD | NEW |