OLD | NEW |
1 #!/usr/bin/env dart | 1 #!/usr/bin/env dart |
2 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 2 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
3 // for details. All rights reserved. Use of this source code is governed by a | 3 // for details. All rights reserved. Use of this source code is governed by a |
4 // BSD-style license that can be found in the LICENSE file. | 4 // BSD-style license that can be found in the LICENSE file. |
5 | 5 |
6 /// Runs io.js with dev_compiler's generated code. | 6 /// Runs io.js with dev_compiler's generated code. |
7 library dev_compiler.bin.devrun; | 7 library dev_compiler.bin.devrun; |
8 | 8 |
9 import 'dart:io'; | 9 import 'dart:io'; |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 void _showUsageAndExit() { | 22 void _showUsageAndExit() { |
23 print('usage: ${_appName} [<options>] <file.dart>\n'); | 23 print('usage: ${_appName} [<options>] <file.dart>\n'); |
24 print('<file.dart> is a single Dart file to run.\n'); | 24 print('<file.dart> is a single Dart file to run.\n'); |
25 print('<options> include:\n'); | 25 print('<options> include:\n'); |
26 print(argParser.usage); | 26 print(argParser.usage); |
27 exit(1); | 27 exit(1); |
28 } | 28 } |
29 | 29 |
30 main(List<String> args) async { | 30 main(List<String> args) async { |
31 args = [] | |
32 ..add('--arrow-fn-bind-this') | |
33 ..addAll(args); | |
34 | |
35 CompilerOptions options; | 31 CompilerOptions options; |
36 | 32 |
37 try { | 33 try { |
38 options = validateOptions(args, forceOutDir: true); | 34 options = validateOptions(args, forceOutDir: true); |
39 } on FormatException catch (e) { | 35 } on FormatException catch (e) { |
40 print('${e.message}\n'); | 36 print('${e.message}\n'); |
41 _showUsageAndExit(); | 37 _showUsageAndExit(); |
42 } | 38 } |
43 | 39 |
44 if (options == null || options.help) _showUsageAndExit(); | 40 if (options == null || options.help) _showUsageAndExit(); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 81 |
86 stderr.writeln( | 82 stderr.writeln( |
87 'Wrote $htmlOutput. It can be opened in Chrome Dev with the following flag
s:\n' | 83 'Wrote $htmlOutput. It can be opened in Chrome Dev with the following flag
s:\n' |
88 '--js-flags="--harmony-arrow-functions ' | 84 '--js-flags="--harmony-arrow-functions ' |
89 '--harmony-classes ' | 85 '--harmony-classes ' |
90 '--harmony-computed-property-names ' | 86 '--harmony-computed-property-names ' |
91 '--harmony_destructuring ' | 87 '--harmony_destructuring ' |
92 '--harmony-spreadcalls"' | 88 '--harmony-spreadcalls"' |
93 '\n'); | 89 '\n'); |
94 } | 90 } |
OLD | NEW |