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

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

Issue 1271953003: dart2js: Add a header to the output of the startup emitter. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Add flavor section to generatedBy comment. Created 5 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 unified diff | Download patch
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 library dart2js.js_emitter.headers;
6 import '../apiimpl.dart' show Compiler;
7
8 String generatedBy(Compiler compiler, {String flavor: ""}) {
9 String suffix = '';
10 if (compiler.hasBuildId) suffix = ' version: ${compiler.buildId}';
11 if (flavor != "") flavor = " ($flavor)";
12 return '// Generated by dart2js$flavor, '
13 'the Dart to JavaScript compiler$suffix.';
14 }
15
16 const String HOOKS_API_USAGE = """
17 // The code supports the following hooks:
18 // dartPrint(message):
19 // if this function is defined it is called instead of the Dart [print]
20 // method.
21 //
22 // dartMainRunner(main, args):
23 // 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
25 // [args] is passed to [dartMainRunner].
26 //
27 // dartDeferredLibraryLoader(uri, successCallback, errorCallback):
28 // 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
30 // successCallback. If it fails to do so, it should call errorCallback with
31 // an error.
32 """;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698