| OLD | NEW |
| (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) { |
| 9 String suffix = ''; |
| 10 if (compiler.hasBuildId) suffix = ' version: ${compiler.buildId}'; |
| 11 return '// Generated by dart2js, the Dart to JavaScript compiler$suffix.'; |
| 12 } |
| 13 |
| 14 const String HOOKS_API_USAGE = """ |
| 15 // The code supports the following hooks: |
| 16 // dartPrint(message): |
| 17 // if this function is defined it is called instead of the Dart [print] |
| 18 // method. |
| 19 // |
| 20 // dartMainRunner(main, args): |
| 21 // if this function is defined, the Dart [main] method will not be invoked |
| 22 // directly. Instead, a closure that will invoke [main], and its arguments |
| 23 // [args] is passed to [dartMainRunner]. |
| 24 // |
| 25 // dartDeferredLibraryLoader(uri, successCallback, errorCallback): |
| 26 // if this function is defined, it will be called when a deferered library |
| 27 // is loaded. It should load and eval the javascript of `uri`, and call |
| 28 // successCallback. If it fails to do so, it should call errorCallback with |
| 29 // an error. |
| 30 """; |
| OLD | NEW |