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

Side by Side Diff: pkg/compiler/lib/src/js_emitter/headers.dart

Issue 1803303002: Move all flags to CompilerOptions (first step to stop passing the compiler to (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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 unified diff | Download patch
OLDNEW
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 library dart2js.js_emitter.headers; 5 library dart2js.js_emitter.headers;
6 import '../compiler.dart' show Compiler; 6 import '../compiler.dart' show Compiler;
7 7
8 String generatedBy(Compiler compiler, {String flavor: ""}) { 8 String generatedBy(Compiler compiler, {String flavor: ""}) {
9 String suffix = ''; 9 String suffix = '';
10 if (compiler.hasBuildId) suffix = ' version: ${compiler.buildId}'; 10 if (compiler.options.hasBuildId) {
11 suffix = ' version: ${compiler.options.buildId}';
12 }
11 if (flavor != "") flavor = " ($flavor)"; 13 if (flavor != "") flavor = " ($flavor)";
12 return '// Generated by dart2js$flavor, ' 14 return '// Generated by dart2js$flavor, '
13 'the Dart to JavaScript compiler$suffix.'; 15 'the Dart to JavaScript compiler$suffix.';
14 } 16 }
15 17
16 const String HOOKS_API_USAGE = """ 18 const String HOOKS_API_USAGE = """
17 // The code supports the following hooks: 19 // The code supports the following hooks:
18 // dartPrint(message): 20 // dartPrint(message):
19 // if this function is defined it is called instead of the Dart [print] 21 // if this function is defined it is called instead of the Dart [print]
20 // method. 22 // method.
21 // 23 //
22 // dartMainRunner(main, args): 24 // dartMainRunner(main, args):
23 // if this function is defined, the Dart [main] method will not be invoked 25 // if this function is defined, the Dart [main] method will not be invoked
24 // directly. Instead, a closure that will invoke [main], and its arguments 26 // directly. Instead, a closure that will invoke [main], and its arguments
25 // [args] is passed to [dartMainRunner]. 27 // [args] is passed to [dartMainRunner].
26 // 28 //
27 // dartDeferredLibraryLoader(uri, successCallback, errorCallback): 29 // dartDeferredLibraryLoader(uri, successCallback, errorCallback):
28 // if this function is defined, it will be called when a deferered library 30 // if this function is defined, it will be called when a deferered library
29 // is loaded. It should load and eval the javascript of `uri`, and call 31 // is loaded. It should load and eval the javascript of `uri`, and call
30 // successCallback. If it fails to do so, it should call errorCallback with 32 // successCallback. If it fails to do so, it should call errorCallback with
31 // an error. 33 // an error.
32 """; 34 """;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698