| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
| 4 | 4 |
| 5 library fasta.testing.suite; | 5 library fasta.testing.suite; |
| 6 | 6 |
| 7 import 'dart:async' show Future; | 7 import 'dart:async' show Future; |
| 8 | 8 |
| 9 import 'dart:io' show File; | 9 import 'dart:io' show File; |
| 10 | 10 |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 platformOutline.unbindCanonicalNames(); | 209 platformOutline.unbindCanonicalNames(); |
| 210 dillTarget.loader.appendLibraries(platformOutline); | 210 dillTarget.loader.appendLibraries(platformOutline); |
| 211 KernelTarget sourceTarget = astKind == AstKind.Analyzer | 211 KernelTarget sourceTarget = astKind == AstKind.Analyzer |
| 212 ? new AnalyzerTarget(dillTarget, context.uriTranslator, strongMode) | 212 ? new AnalyzerTarget(dillTarget, context.uriTranslator, strongMode) |
| 213 : new KernelTarget(PhysicalFileSystem.instance, dillTarget, | 213 : new KernelTarget(PhysicalFileSystem.instance, dillTarget, |
| 214 context.uriTranslator, strongMode); | 214 context.uriTranslator, strongMode); |
| 215 | 215 |
| 216 Program p; | 216 Program p; |
| 217 try { | 217 try { |
| 218 sourceTarget.read(description.uri); | 218 sourceTarget.read(description.uri); |
| 219 await dillTarget.computeOutline(); | 219 await dillTarget.buildOutlines(); |
| 220 ValidatingInstrumentation instrumentation; | 220 ValidatingInstrumentation instrumentation; |
| 221 if (strongMode) { | 221 if (strongMode) { |
| 222 instrumentation = new ValidatingInstrumentation(); | 222 instrumentation = new ValidatingInstrumentation(); |
| 223 await instrumentation.loadExpectations(description.uri); | 223 await instrumentation.loadExpectations(description.uri); |
| 224 sourceTarget.loader.instrumentation = instrumentation; | 224 sourceTarget.loader.instrumentation = instrumentation; |
| 225 } | 225 } |
| 226 await sourceTarget.computeOutline(); | 226 p = await sourceTarget.buildOutlines(); |
| 227 p = sourceTarget.program; | |
| 228 if (fullCompile) { | 227 if (fullCompile) { |
| 229 p = await sourceTarget.writeProgram(null); | 228 p = await sourceTarget.buildProgram(); |
| 230 instrumentation?.finish(); | 229 instrumentation?.finish(); |
| 231 if (instrumentation != null && instrumentation.hasProblems) { | 230 if (instrumentation != null && instrumentation.hasProblems) { |
| 232 if (updateComments) { | 231 if (updateComments) { |
| 233 await instrumentation.fixSource(description.uri); | 232 await instrumentation.fixSource(description.uri); |
| 234 } else { | 233 } else { |
| 235 return fail(null, instrumentation.problemsAsString); | 234 return fail(null, instrumentation.problemsAsString); |
| 236 } | 235 } |
| 237 } | 236 } |
| 238 } | 237 } |
| 239 } on InputError catch (e, s) { | 238 } on InputError catch (e, s) { |
| 240 return fail(null, e.error, s); | 239 return fail(null, e.error, s); |
| 241 } | 240 } |
| 242 return pass(p); | 241 return pass(p); |
| 243 } | 242 } |
| 244 } | 243 } |
| OLD | NEW |