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

Side by Side Diff: pkg/compiler/lib/src/dart2js.dart

Issue 2482923002: Use `Function` as function type syntax.
Patch Set: Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « pkg/compiler/lib/src/compiler.dart ('k') | pkg/compiler/lib/src/dart_types.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 dart2js.cmdline; 5 library dart2js.cmdline;
6 6
7 import 'dart:async' show EventSink, Future; 7 import 'dart:async' show EventSink, Future;
8 import 'dart:convert' show UTF8, LineSplitter; 8 import 'dart:convert' show UTF8, LineSplitter;
9 import 'dart:io' show exit, File, FileMode, Platform, stdin, stderr; 9 import 'dart:io' show exit, File, FileMode, Platform, stdin, stderr;
10 10
(...skipping 22 matching lines...) Expand all
33 * 33 *
34 * The actual string is rewritten by a wrapper script when included in the sdk. 34 * The actual string is rewritten by a wrapper script when included in the sdk.
35 */ 35 */
36 String BUILD_ID = null; 36 String BUILD_ID = null;
37 37
38 /** 38 /**
39 * The data passed to the [HandleOption] callback is either a single 39 * The data passed to the [HandleOption] callback is either a single
40 * string argument, or the arguments iterator for multiple arguments 40 * string argument, or the arguments iterator for multiple arguments
41 * handlers. 41 * handlers.
42 */ 42 */
43 typedef void HandleOption(data); 43 typedef HandleOption = void Function(dynamic data);
44 44
45 class OptionHandler { 45 class OptionHandler {
46 final String pattern; 46 final String pattern;
47 final HandleOption handle; 47 final HandleOption handle;
48 final bool multipleArguments; 48 final bool multipleArguments;
49 49
50 OptionHandler(this.pattern, this.handle, {this.multipleArguments: false}); 50 OptionHandler(this.pattern, this.handle, {this.multipleArguments: false});
51 } 51 }
52 52
53 /** 53 /**
(...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after
754 void main(List<String> arguments) { 754 void main(List<String> arguments) {
755 // Since the sdk/bin/dart2js script adds its own arguments in front of 755 // Since the sdk/bin/dart2js script adds its own arguments in front of
756 // user-supplied arguments we search for '--batch' at the end of the list. 756 // user-supplied arguments we search for '--batch' at the end of the list.
757 if (arguments.length > 0 && arguments.last == "--batch") { 757 if (arguments.length > 0 && arguments.last == "--batch") {
758 batchMain(arguments.sublist(0, arguments.length - 1)); 758 batchMain(arguments.sublist(0, arguments.length - 1));
759 return; 759 return;
760 } 760 }
761 internalMain(arguments); 761 internalMain(arguments);
762 } 762 }
763 763
764 typedef void ExitFunc(int exitCode); 764 typedef ExitFunc = void Function(int exitCode);
765 typedef Future<api.CompilationResult> CompileFunc( 765 typedef CompileFunc = Future<api.CompilationResult> Function(
766 CompilerOptions compilerOptions, 766 CompilerOptions compilerOptions,
767 api.CompilerInput compilerInput, 767 api.CompilerInput compilerInput,
768 api.CompilerDiagnostics compilerDiagnostics, 768 api.CompilerDiagnostics compilerDiagnostics,
769 api.CompilerOutput compilerOutput); 769 api.CompilerOutput compilerOutput);
770 770
771 ExitFunc exitFunc = exit; 771 ExitFunc exitFunc = exit;
772 CompileFunc compileFunc = api.compile; 772 CompileFunc compileFunc = api.compile;
773 773
774 Future<api.CompilationResult> internalMain(List<String> arguments) { 774 Future<api.CompilationResult> internalMain(List<String> arguments) {
775 Future onError(exception, trace) { 775 Future onError(exception, trace) {
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
1031 @override 1031 @override
1032 void close() { 1032 void close() {
1033 // Do nothing. 1033 // Do nothing.
1034 } 1034 }
1035 1035
1036 @override 1036 @override
1037 void addError(errorEvent, [StackTrace stackTrace]) { 1037 void addError(errorEvent, [StackTrace stackTrace]) {
1038 // Ignore 1038 // Ignore
1039 } 1039 }
1040 } 1040 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/compiler.dart ('k') | pkg/compiler/lib/src/dart_types.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698