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 file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 /// This is an interface to the Dart Kernel parser and Kernel binary generator. | 5 /// This is an interface to the Dart Kernel parser and Kernel binary generator. |
6 /// | 6 /// |
7 /// It is used by the kernel-isolate to load Dart source code and generate | 7 /// It is used by the kernel-isolate to load Dart source code and generate |
8 /// Kernel binary format. | 8 /// Kernel binary format. |
9 /// | 9 /// |
10 /// This is either invoked as the root script of the Kernel isolate when used | 10 /// This is either invoked as the root script of the Kernel isolate when used |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 kernelTarget.read(fileName); | 168 kernelTarget.read(fileName); |
169 await dillTarget.writeOutline(null); | 169 await dillTarget.writeOutline(null); |
170 program = await kernelTarget.writeOutline(null); | 170 program = await kernelTarget.writeOutline(null); |
171 program = await kernelTarget.writeProgram(null, AstKind.Kernel); | 171 program = await kernelTarget.writeProgram(null, AstKind.Kernel); |
172 if (kernelTarget.errors.isNotEmpty) { | 172 if (kernelTarget.errors.isNotEmpty) { |
173 return new CompilationError(kernelTarget.errors | 173 return new CompilationError(kernelTarget.errors |
174 .map((err) => err.toString()) | 174 .map((err) => err.toString()) |
175 .toList(growable: false)); | 175 .toList(growable: false)); |
176 } | 176 } |
177 } on InputError catch (e) { | 177 } on InputError catch (e) { |
178 return new CompilationError(<String>[e.error]); | 178 return new CompilationError(<String>[e.format()]); |
179 } | 179 } |
180 } else { | 180 } else { |
181 DartOptions dartOptions = new DartOptions( | 181 DartOptions dartOptions = new DartOptions( |
182 strongMode: false, | 182 strongMode: false, |
183 strongModeSdk: false, | 183 strongModeSdk: false, |
184 sdk: sdkPath, | 184 sdk: sdkPath, |
185 packagePath: packageConfig, | 185 packagePath: packageConfig, |
186 customUriMappings: const {}, | 186 customUriMappings: const {}, |
187 declaredVariables: const {}); | 187 declaredVariables: const {}); |
188 DartLoader loader = | 188 DartLoader loader = |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 if (await new File.fromUri(packagesFile).exists()) { | 398 if (await new File.fromUri(packagesFile).exists()) { |
399 return packagesFile; | 399 return packagesFile; |
400 } | 400 } |
401 if (dir.parent.path == dir.path) { | 401 if (dir.parent.path == dir.path) { |
402 break; | 402 break; |
403 } | 403 } |
404 dir = dir.parent; | 404 dir = dir.parent; |
405 } | 405 } |
406 return null; | 406 return null; |
407 } | 407 } |
OLD | NEW |