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 part of LibraryPrefixesTest2.lib; | 5 part of LibraryPrefixesTest2.lib; |
6 | 6 |
7 class Constants { | 7 class Constants { |
8 static const PI = 3.14; | 8 static const PI = 3.14; |
9 static const foo = 2; | 9 static const foo = 2; |
10 } | 10 } |
11 | 11 |
12 class A { | 12 class A { |
13 static const y = 0; | 13 static const y = 0; |
14 int x; | 14 int x; |
15 A() : x = 2 {} | 15 A() : x = 2 {} |
16 A.named() : x = 4 {} | 16 A.named() : x = 4 {} |
17 A.superC(x) : x = x + 11 {} | 17 A.superC(x) : x = x + 11 {} |
18 factory A.fac() { return new A.named(); } | 18 factory A.fac() { |
| 19 return new A.named(); |
| 20 } |
19 } | 21 } |
20 | 22 |
21 class B extends A { | 23 class B extends A { |
22 B() : super() {} | 24 B() : super() {} |
23 B.named() : super.superC(2) {} | 25 B.named() : super.superC(2) {} |
24 factory B.fac() { return new B.named(); } | 26 factory B.fac() { |
| 27 return new B.named(); |
| 28 } |
25 } | 29 } |
26 | 30 |
27 class C { | 31 class C { |
28 final int x; | 32 final int x; |
29 const C() : x = 2; | 33 const C() : x = 2; |
30 const C.named() : x = 4; | 34 const C.named() : x = 4; |
31 const C.superC(x) : x = x + 11; | 35 const C.superC(x) : x = x + 11; |
32 factory C.fac() { return const C.named(); } | 36 factory C.fac() { |
| 37 return const C.named(); |
| 38 } |
33 } | 39 } |
34 | 40 |
35 class D extends C { | 41 class D extends C { |
36 const D() : super(); | 42 const D() : super(); |
37 const D.named() : super.superC(2); | 43 const D.named() : super.superC(2); |
38 factory D.fac() { return const D.named(); } | 44 factory D.fac() { |
| 45 return const D.named(); |
| 46 } |
39 } | 47 } |
40 | 48 |
41 class E { | 49 class E { |
42 var f; | 50 var f; |
43 E() {} | 51 E() {} |
44 E.fun(x) : f = (() { return x + 13; }) {} | 52 E.fun(x) |
45 static foo() { return 3; } | 53 : f = (() { |
46 static fooo(x) { return () { return x + 1024; }; } | 54 return x + 13; |
47 bar() { return 4; } | 55 }) {} |
48 toto(x) { return () { return x + 5; }; } | 56 static foo() { |
| 57 return 3; |
| 58 } |
| 59 |
| 60 static fooo(x) { |
| 61 return () { |
| 62 return x + 1024; |
| 63 }; |
| 64 } |
| 65 |
| 66 bar() { |
| 67 return 4; |
| 68 } |
| 69 |
| 70 toto(x) { |
| 71 return () { |
| 72 return x + 5; |
| 73 }; |
| 74 } |
49 } | 75 } |
OLD | NEW |