| 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'; |
| 11 | 11 |
| 12 const CORE_LIB = """ | 12 const CORE_LIB = """ |
| 13 library core; | 13 library core; |
| 14 class Object { | 14 class Object { |
| 15 Object(); | 15 const Object(); |
| 16 operator==(other) {} | 16 operator==(other) {} |
| 17 } | 17 } |
| 18 class bool {} | 18 class bool {} |
| 19 class num {} | 19 class num {} |
| 20 class int {} | 20 class int {} |
| 21 class double{} | 21 class double{} |
| 22 class String{} | 22 class String{} |
| 23 class Function{} | 23 class Function{} |
| 24 class List {} | 24 class List {} |
| 25 class Map {} | 25 class Map {} |
| 26 class BoundClosure {} | 26 class BoundClosure {} |
| 27 class Closure {} | 27 class Closure {} |
| 28 class Dynamic_ {} | 28 class Dynamic_ {} |
| 29 class Type {} | 29 class Type {} |
| 30 class Null {} | 30 class Null {} |
| 31 class StackTrace {} | 31 class StackTrace {} |
| 32 class LinkedHashMap {} | 32 class LinkedHashMap {} |
| 33 getRuntimeTypeInfo(o) {} | 33 getRuntimeTypeInfo(o) {} |
| 34 setRuntimeTypeInfo(o, i) {} | 34 setRuntimeTypeInfo(o, i) {} |
| 35 eqNull(a) {} | 35 eqNull(a) {} |
| 36 eqNullB(a) {} | 36 eqNullB(a) {} |
| 37 class JSInvocationMirror {} // Should be in helper. | 37 class JSInvocationMirror {} // Should be in helper. |
| 38 class _Proxy { const _Proxy(); } |
| 39 const proxy = const _Proxy(); |
| 38 """; | 40 """; |
| 39 | 41 |
| 40 const INTERCEPTORS_LIB = """ | 42 const INTERCEPTORS_LIB = """ |
| 41 library interceptors; | 43 library interceptors; |
| 42 class JSIndexable { | 44 class JSIndexable { |
| 43 get length; | 45 get length; |
| 44 } | 46 } |
| 45 class JSMutableIndexable {} | 47 class JSMutableIndexable {} |
| 46 class JSArray { | 48 class JSArray { |
| 47 JSArray() {} | 49 JSArray() {} |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 Expect.isNull(code); | 127 Expect.isNull(code); |
| 126 Expect.isTrue(10 < count); | 128 Expect.isTrue(10 < count); |
| 127 // Two warnings for each time RECURSIVE_MAIN is read, except the | 129 // Two warnings for each time RECURSIVE_MAIN is read, except the |
| 128 // first time. | 130 // first time. |
| 129 Expect.equals(2 * (count - 1), warningCount); | 131 Expect.equals(2 * (count - 1), warningCount); |
| 130 Expect.equals(1, errorCount); | 132 Expect.equals(1, errorCount); |
| 131 }, onError: (e) { | 133 }, onError: (e) { |
| 132 throw 'Compilation failed'; | 134 throw 'Compilation failed'; |
| 133 }).then(asyncSuccess); | 135 }).then(asyncSuccess); |
| 134 } | 136 } |
| OLD | NEW |