| 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 'dart:async'; | 8 import 'dart:async'; |
| 9 import '../../sdk/lib/_internal/compiler/compiler.dart'; | 9 import '../../sdk/lib/_internal/compiler/compiler.dart'; |
| 10 import 'dart:uri'; | 10 import 'dart:uri'; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 getRuntimeTypeInfo(o) {} | 30 getRuntimeTypeInfo(o) {} |
| 31 setRuntimeTypeInfo(o, i) {} | 31 setRuntimeTypeInfo(o, i) {} |
| 32 eqNull(a) {} | 32 eqNull(a) {} |
| 33 eqNullB(a) {} | 33 eqNullB(a) {} |
| 34 class JSInvocationMirror {} // Should be in helper. | 34 class JSInvocationMirror {} // Should be in helper. |
| 35 """; | 35 """; |
| 36 | 36 |
| 37 const INTERCEPTORS_LIB = """ | 37 const INTERCEPTORS_LIB = """ |
| 38 library interceptors; | 38 library interceptors; |
| 39 class JSArray { | 39 class JSArray { |
| 40 get length => null; | |
| 41 removeLast() => null; | 40 removeLast() => null; |
| 42 add(x) { } | 41 add(x) { } |
| 43 } | 42 } |
| 44 class JSString { | 43 class JSString { |
| 45 get length => null; | |
| 46 split(x) => null; | 44 split(x) => null; |
| 47 concat(x) => null; | 45 concat(x) => null; |
| 48 toString() => null; | 46 toString() => null; |
| 49 } | 47 } |
| 50 """; | 48 """; |
| 51 | 49 |
| 52 const String RECURSIVE_MAIN = """ | 50 const String RECURSIVE_MAIN = """ |
| 53 library fisk; | 51 library fisk; |
| 54 import 'recurse/fisk.dart'; | 52 import 'recurse/fisk.dart'; |
| 55 main() {} | 53 main() {} |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 Expect.isNull(code); | 109 Expect.isNull(code); |
| 112 Expect.isTrue(10 < count); | 110 Expect.isTrue(10 < count); |
| 113 // Two warnings for each time RECURSIVE_MAIN is read, except the | 111 // Two warnings for each time RECURSIVE_MAIN is read, except the |
| 114 // first time. | 112 // first time. |
| 115 Expect.equals(2 * (count - 1), warningCount); | 113 Expect.equals(2 * (count - 1), warningCount); |
| 116 Expect.equals(1, errorCount); | 114 Expect.equals(1, errorCount); |
| 117 }, onError: (e) { | 115 }, onError: (e) { |
| 118 throw 'Compilation failed'; | 116 throw 'Compilation failed'; |
| 119 }); | 117 }); |
| 120 } | 118 } |
| OLD | NEW |