OLD | NEW |
| (Empty) |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | |
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. | |
4 | |
5 | |
6 // Codegen dependency order test | |
7 const UNINITIALIZED = const _Uninitialized(); | |
8 class _Uninitialized { const _Uninitialized(); } | |
9 | |
10 class Generic<T> { | |
11 Type get type => Generic; | |
12 // type parameter type literals | |
13 m() => print(T); | |
14 } | |
15 | |
16 // super == | |
17 // https://github.com/dart-lang/dev_compiler/issues/226 | |
18 class Base { | |
19 int x = 1, y = 2; | |
20 operator==(obj) { | |
21 return obj is Base && obj.x == x && obj.y == y; | |
22 } | |
23 } | |
24 class Derived { | |
25 int z = 3; | |
26 operator==(obj) { | |
27 return obj is Derived && obj.z == z && super == obj; | |
28 } | |
29 } | |
30 | |
31 // string escape tests | |
32 // https://github.com/dart-lang/dev_compiler/issues/227 | |
33 bool _isWhitespace(String ch) => | |
34 ch == ' ' || ch == '\n' || ch == '\r' || ch == '\t'; | |
35 | |
36 const expr = 'foo'; | |
37 const _escapeMap = const { | |
38 '\n': r'\n', | |
39 '\r': r'\r', | |
40 '\f': r'\f', | |
41 '\b': r'\b', | |
42 '\t': r'\t', | |
43 '\v': r'\v', | |
44 '\x7F': r'\x7F', // delete | |
45 '\${${expr}}': '' | |
46 }; | |
47 | |
48 | |
49 main() { | |
50 // Number literals in call expressions. | |
51 print(1.toString()); | |
52 print(1.0.toString()); | |
53 print(1.1.toString()); | |
54 | |
55 // Type literals, #184 | |
56 dynamic x = 42; | |
57 print(x == dynamic); | |
58 print(x == Generic); | |
59 | |
60 // Should be Generic<dynamic> | |
61 print(new Generic<int>().type); | |
62 | |
63 print(new Derived() == new Derived()); // true | |
64 | |
65 new Generic<int>().m(); | |
66 } | |
OLD | NEW |