| 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 18 matching lines...) Expand all Loading... |
| 29 class LinkedHashMap {} | 29 class LinkedHashMap {} |
| 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 JSIndexable { |
| 40 get length; |
| 41 } |
| 39 class JSArray { | 42 class JSArray { |
| 40 get length => null; | |
| 41 removeLast() => null; | 43 removeLast() => null; |
| 42 add(x) { } | 44 add(x) { } |
| 43 } | 45 } |
| 44 class JSString { | 46 class JSString { |
| 45 get length => null; | |
| 46 split(x) => null; | 47 split(x) => null; |
| 47 concat(x) => null; | 48 concat(x) => null; |
| 48 toString() => null; | 49 toString() => null; |
| 49 } | 50 } |
| 50 """; | 51 """; |
| 51 | 52 |
| 52 const String RECURSIVE_MAIN = """ | 53 const String RECURSIVE_MAIN = """ |
| 53 library fisk; | 54 library fisk; |
| 54 import 'recurse/fisk.dart'; | 55 import 'recurse/fisk.dart'; |
| 55 main() {} | 56 main() {} |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 Expect.isNull(code); | 112 Expect.isNull(code); |
| 112 Expect.isTrue(10 < count); | 113 Expect.isTrue(10 < count); |
| 113 // Two warnings for each time RECURSIVE_MAIN is read, except the | 114 // Two warnings for each time RECURSIVE_MAIN is read, except the |
| 114 // first time. | 115 // first time. |
| 115 Expect.equals(2 * (count - 1), warningCount); | 116 Expect.equals(2 * (count - 1), warningCount); |
| 116 Expect.equals(1, errorCount); | 117 Expect.equals(1, errorCount); |
| 117 }, onError: (e) { | 118 }, onError: (e) { |
| 118 throw 'Compilation failed'; | 119 throw 'Compilation failed'; |
| 119 }); | 120 }); |
| 120 } | 121 } |
| OLD | NEW |