| 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 15 matching lines...) Expand all Loading... |
| 26 /// | 26 /// |
| 27 /// The source can be represented either as a [:List<int>:] of UTF-8 bytes or | 27 /// The source can be represented either as a [:List<int>:] of UTF-8 bytes or |
| 28 /// as a [String]. | 28 /// as a [String]. |
| 29 /// | 29 /// |
| 30 /// The following text is non-normative: | 30 /// The following text is non-normative: |
| 31 /// | 31 /// |
| 32 /// It is recommended to return a UTF-8 encoded list of bytes because the | 32 /// It is recommended to return a UTF-8 encoded list of bytes because the |
| 33 /// scanner is more efficient in this case. In either case, the data structure | 33 /// scanner is more efficient in this case. In either case, the data structure |
| 34 /// is expected to hold a zero element at the last position. If this is not | 34 /// is expected to hold a zero element at the last position. If this is not |
| 35 /// the case, the entire data structure is copied before scanning. | 35 /// the case, the entire data structure is copied before scanning. |
| 36 Future/*<String | List<int>>*/ readFromUri(Uri uri); | 36 Future /* <String | List<int>> */ readFromUri(Uri uri); |
| 37 } | 37 } |
| 38 | 38 |
| 39 /// Output types used in `CompilerOutput.createOutputSink`. | 39 /// Output types used in `CompilerOutput.createOutputSink`. |
| 40 enum OutputType { | 40 enum OutputType { |
| 41 /// The main JavaScript output. | 41 /// The main JavaScript output. |
| 42 js, | 42 js, |
| 43 | 43 |
| 44 /// A deferred JavaScript output part. | 44 /// A deferred JavaScript output part. |
| 45 jsPart, | 45 jsPart, |
| 46 | 46 |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 if (compilerOutput == null) { | 140 if (compilerOutput == null) { |
| 141 throw new ArgumentError("compilerOutput must be non-null"); | 141 throw new ArgumentError("compilerOutput must be non-null"); |
| 142 } | 142 } |
| 143 | 143 |
| 144 CompilerImpl compiler = new CompilerImpl( | 144 CompilerImpl compiler = new CompilerImpl( |
| 145 compilerInput, compilerOutput, compilerDiagnostics, compilerOptions); | 145 compilerInput, compilerOutput, compilerDiagnostics, compilerOptions); |
| 146 return compiler.run(compilerOptions.entryPoint).then((bool success) { | 146 return compiler.run(compilerOptions.entryPoint).then((bool success) { |
| 147 return new CompilationResult(compiler, isSuccess: success); | 147 return new CompilationResult(compiler, isSuccess: success); |
| 148 }); | 148 }); |
| 149 } | 149 } |
| OLD | NEW |