OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 /// New Compiler API. This API is under construction, use only internally or | 5 /// New Compiler API. This API is under construction, use only internally or |
6 /// in unittests. | 6 /// in unittests. |
7 | 7 |
8 library compiler_new; | 8 library compiler_new; |
9 | 9 |
10 import 'dart:async'; | 10 import 'dart:async'; |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 if (compilerInput == null) { | 161 if (compilerInput == null) { |
162 throw new ArgumentError("compilerInput must be non-null"); | 162 throw new ArgumentError("compilerInput must be non-null"); |
163 } | 163 } |
164 if (compilerDiagnostics == null) { | 164 if (compilerDiagnostics == null) { |
165 throw new ArgumentError("compilerDiagnostics must be non-null"); | 165 throw new ArgumentError("compilerDiagnostics must be non-null"); |
166 } | 166 } |
167 if (compilerOutput == null) { | 167 if (compilerOutput == null) { |
168 throw new ArgumentError("compilerOutput must be non-null"); | 168 throw new ArgumentError("compilerOutput must be non-null"); |
169 } | 169 } |
170 | 170 |
171 Compiler compiler = new Compiler( | 171 CompilerImpl compiler = new CompilerImpl( |
172 compilerInput, | 172 compilerInput, |
173 compilerOutput, | 173 compilerOutput, |
174 compilerDiagnostics, | 174 compilerDiagnostics, |
175 compilerOptions.libraryRoot, | 175 compilerOptions.libraryRoot, |
176 compilerOptions.packageRoot, | 176 compilerOptions.packageRoot, |
177 compilerOptions.options, | 177 compilerOptions.options, |
178 compilerOptions.environment, | 178 compilerOptions.environment, |
179 compilerOptions.packageConfig, | 179 compilerOptions.packageConfig, |
180 compilerOptions.packagesDiscoveryProvider); | 180 compilerOptions.packagesDiscoveryProvider); |
181 return compiler.run(compilerOptions.entryPoint).then((bool success) { | 181 return compiler.run(compilerOptions.entryPoint).then((bool success) { |
182 return new CompilationResult(compiler, isSuccess: success); | 182 return new CompilationResult(compiler, isSuccess: success); |
183 }); | 183 }); |
184 } | 184 } |
OLD | NEW |