OLD | NEW |
---|---|
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 of "recursive" imports using the dart2js compiler API. | 5 // Test of "recursive" imports using the dart2js compiler API. |
6 | 6 |
7 import "package:expect/expect.dart"; | 7 import "package:expect/expect.dart"; |
8 import "package:async_helper/async_helper.dart"; | 8 import "package:async_helper/async_helper.dart"; |
9 import 'dart:async'; | 9 import 'dart:async'; |
10 import '../../sdk/lib/_internal/compiler/compiler.dart'; | 10 import '../../sdk/lib/_internal/compiler/compiler.dart'; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
54 class JSMutableArray extends JSArray {} | 54 class JSMutableArray extends JSArray {} |
55 class JSExtendableArray extends JSMutableArray {} | 55 class JSExtendableArray extends JSMutableArray {} |
56 class JSFixedArray extends JSMutableArray {} | 56 class JSFixedArray extends JSMutableArray {} |
57 class JSString { | 57 class JSString { |
58 split(x) => null; | 58 split(x) => null; |
59 concat(x) => null; | 59 concat(x) => null; |
60 toString() => null; | 60 toString() => null; |
61 operator+(other) => null; | 61 operator+(other) => null; |
62 } | 62 } |
63 class JSNull { | 63 class JSNull { |
64 bool operator ==(other) => identical(null, other); | |
karlklose
2014/05/01 07:44:08
`false` would have been sufficient.
floitsch
2014/05/03 23:21:48
Copy/paste from another JSNull implementation from
| |
65 int get hashCode => 0; | |
64 } | 66 } |
65 class JSBool { | 67 class JSBool { |
66 } | 68 } |
67 """; | 69 """; |
68 | 70 |
69 const String RECURSIVE_MAIN = """ | 71 const String RECURSIVE_MAIN = """ |
70 library fisk; | 72 library fisk; |
71 import 'recurse/fisk.dart'; | 73 import 'recurse/fisk.dart'; |
72 main() {} | 74 main() {} |
73 """; | 75 """; |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
127 Expect.isNull(code); | 129 Expect.isNull(code); |
128 Expect.isTrue(10 < count); | 130 Expect.isTrue(10 < count); |
129 // Two warnings for each time RECURSIVE_MAIN is read, except the | 131 // Two warnings for each time RECURSIVE_MAIN is read, except the |
130 // first time. | 132 // first time. |
131 Expect.equals(2 * (count - 1), warningCount); | 133 Expect.equals(2 * (count - 1), warningCount); |
132 Expect.equals(1, errorCount); | 134 Expect.equals(1, errorCount); |
133 }, onError: (e) { | 135 }, onError: (e) { |
134 throw 'Compilation failed'; | 136 throw 'Compilation failed'; |
135 }).then(asyncSuccess); | 137 }).then(asyncSuccess); |
136 } | 138 } |
OLD | NEW |