Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(160)

Unified Diff: web/main.dart

Issue 2208243002: Restructured the set up for the compiling function. Also added room for list of additional summarie… (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Added module names and bundle names to allow for import statements in the console. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | web/web_command.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: web/main.dart
diff --git a/web/main.dart b/web/main.dart
index 32d1ba6583c4c9e5dce187a7361eed8a85f0a4cd..ebf3a91891137936405883c78f5a29686d58fe7a 100755
--- a/web/main.dart
+++ b/web/main.dart
@@ -46,26 +46,22 @@ import 'package:js/js.dart';
import 'web_command.dart';
@JS()
-external set compileDartExpression(Function function);
-
-typedef String CompileFn(String dart);
-typedef void OnLoadFn(CompileFn compile);
+external set setUpCompilerInBrowser(Function function);
Future main() async {
var args = ['compile'];
- _runCommand((result) {
- compileDartExpression = allowInterop(result);
- }, args);
+ _runCommand(args);
}
/// Runs a single compile command, and returns an exit code.
-Future<int> _runCommand(OnLoadFn onload, List<String> args,
+Future<int> _runCommand(List<String> args,
{MessageHandler messageHandler}) async {
try {
+ // TODO: Remove CommandRunner and args if possible. May run into issues
+ // with ArgResults or ArgParsers.
var runner = new CommandRunner('dartdevc', 'Dart Development Compiler');
- runner
- .addCommand(new WebCompileCommand(onload, messageHandler: messageHandler));
- await runner.run(args);
+ runner.addCommand(new WebCompileCommand(messageHandler: messageHandler));
+ setUpCompilerInBrowser = allowInterop(await runner.run(args));
} catch (e, s) {
return _handleError(e, s, args, messageHandler: messageHandler);
}
« no previous file with comments | « no previous file | web/web_command.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698