| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 library dart2js.test.message_kind_helper; | 5 library dart2js.test.message_kind_helper; |
| 6 | 6 |
| 7 import 'package:expect/expect.dart'; | 7 import 'package:expect/expect.dart'; |
| 8 import 'dart:async'; | 8 import 'dart:async'; |
| 9 | 9 |
| 10 import 'package:compiler/implementation/dart2jslib.dart' show | 10 import 'package:compiler/src/dart2jslib.dart' show |
| 11 Compiler, | 11 Compiler, |
| 12 MessageKind; | 12 MessageKind; |
| 13 | 13 |
| 14 import 'memory_compiler.dart'; | 14 import 'memory_compiler.dart'; |
| 15 | 15 |
| 16 const String ESCAPE_REGEXP = r'[[\]{}()*+?.\\^$|]'; | 16 const String ESCAPE_REGEXP = r'[[\]{}()*+?.\\^$|]'; |
| 17 | 17 |
| 18 /// Most examples generate a single diagnostic. | 18 /// Most examples generate a single diagnostic. |
| 19 /// Add an exception here if a single diagnostic cannot be produced. | 19 /// Add an exception here if a single diagnostic cannot be produced. |
| 20 /// However, consider that a single concise diagnostic is easier to understand, | 20 /// However, consider that a single concise diagnostic is easier to understand, |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 Expect.isTrue(!pendingStuff || kindsWithPendingClasses.contains(kind)); | 138 Expect.isTrue(!pendingStuff || kindsWithPendingClasses.contains(kind)); |
| 139 | 139 |
| 140 if (!pendingStuff && !compiler.compilerWasCancelled) { | 140 if (!pendingStuff && !compiler.compilerWasCancelled) { |
| 141 // If there is pending stuff, or the compiler was cancelled, we | 141 // If there is pending stuff, or the compiler was cancelled, we |
| 142 // shouldn't reuse the compiler. | 142 // shouldn't reuse the compiler. |
| 143 cachedCompiler = compiler; | 143 cachedCompiler = compiler; |
| 144 } | 144 } |
| 145 }); | 145 }); |
| 146 }).then((_) => cachedCompiler); | 146 }).then((_) => cachedCompiler); |
| 147 } | 147 } |
| OLD | NEW |