| 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 return new CompilationError(<String>[e.error]); | 178 return new CompilationError(<String>[e.error]); |
| 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 program = new Program(); |
| 188 DartLoader loader = | 189 DartLoader loader = |
| 189 await batch_loader.getLoader(new Repository(), dartOptions); | 190 await batch_loader.getLoader(program, dartOptions); |
| 190 program = loader.loadProgram(fileName, target: target); | 191 loader.loadProgram(fileName, target: target); |
| 191 | 192 |
| 192 if (loader.errors.isNotEmpty) { | 193 if (loader.errors.isNotEmpty) { |
| 193 return new CompilationError(loader.errors.toList(growable: false)); | 194 return new CompilationError(loader.errors.toList(growable: false)); |
| 194 } | 195 } |
| 195 } | 196 } |
| 196 | 197 |
| 197 // Perform target-specific transformations. | 198 // Perform target-specific transformations. |
| 198 target.performModularTransformations(program); | 199 target.performModularTransformations(program); |
| 199 target.performGlobalTransformations(program); | 200 target.performGlobalTransformations(program); |
| 200 | 201 |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 if (await new File.fromUri(packagesFile).exists()) { | 399 if (await new File.fromUri(packagesFile).exists()) { |
| 399 return packagesFile; | 400 return packagesFile; |
| 400 } | 401 } |
| 401 if (dir.parent.path == dir.path) { | 402 if (dir.parent.path == dir.path) { |
| 402 break; | 403 break; |
| 403 } | 404 } |
| 404 dir = dir.parent; | 405 dir = dir.parent; |
| 405 } | 406 } |
| 406 return null; | 407 return null; |
| 407 } | 408 } |
| OLD | NEW |