OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 #library('leg_api'); | 5 #library('leg_api'); |
6 | 6 |
7 #import('../../lib/uri/uri.dart'); | 7 #import('../../lib/uri/uri.dart'); |
8 #import('apiimpl.dart'); | 8 #import('apiimpl.dart'); |
9 | 9 |
10 // Unless explicitly allowed, passing null for any argument to the | 10 // Unless explicitly allowed, passing null for any argument to the |
(...skipping 21 matching lines...) Expand all Loading... |
32 String message, bool fatal); | 32 String message, bool fatal); |
33 | 33 |
34 /** | 34 /** |
35 * Returns [script] compiled to JavaScript. If the compilation fails, | 35 * Returns [script] compiled to JavaScript. If the compilation fails, |
36 * null is returned and [handler] will have been invoked at least once | 36 * null is returned and [handler] will have been invoked at least once |
37 * with [:fatal == true:]. | 37 * with [:fatal == true:]. |
38 */ | 38 */ |
39 Future<String> compile(Uri script, | 39 Future<String> compile(Uri script, |
40 Uri libraryRoot, | 40 Uri libraryRoot, |
41 ReadUriFromString provider, | 41 ReadUriFromString provider, |
42 DiagnosticHandler handler) { | 42 DiagnosticHandler handler, |
43 Compiler compiler = new Compiler(provider, handler, libraryRoot); | 43 [List<String> options = const []]) { |
| 44 Compiler compiler = new Compiler(provider, handler, libraryRoot, options); |
44 compiler.run(script); | 45 compiler.run(script); |
45 String code = compiler.assembledCode; | 46 String code = compiler.assembledCode; |
46 Completer<String> completer = new Completer<String>(); | 47 Completer<String> completer = new Completer<String>(); |
47 completer.complete(code); | 48 completer.complete(code); |
48 return completer.future; | 49 return completer.future; |
49 } | 50 } |
OLD | NEW |