Index: sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart |
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart b/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart |
index 6ecbfd5099e1e4ab723fd545a494966e5544cb0b..e24d33b7b2b9e0412d4a92020812ce4c6f680db1 100644 |
--- a/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart |
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart |
@@ -2948,7 +2948,7 @@ if (typeof document !== "undefined" && document.readyState !== "complete") { |
computeNeededClasses(); |
- mainBuffer.add(GENERATED_BY); |
+ mainBuffer.add(buildGeneratedBy()); |
addComment(HOOKS_API_USAGE, mainBuffer); |
mainBuffer.add('function ${namer.isolateName}()$_{}\n'); |
mainBuffer.add('init()$N$n'); |
@@ -3173,7 +3173,7 @@ if (typeof document !== "undefined" && document.readyState !== "complete") { |
void emitDeferredPreambleWhenEmpty(CodeBuffer buffer) { |
if (!buffer.isEmpty) return; |
- buffer.write(GENERATED_BY); |
+ buffer.write(buildGeneratedBy()); |
buffer.write('var old${namer.CURRENT_ISOLATE}$_=' |
'$_${namer.CURRENT_ISOLATE}$N'); |
@@ -3186,6 +3186,12 @@ if (typeof document !== "undefined" && document.readyState !== "complete") { |
'$_${namer.isolateName}.prototype$N$n'); |
} |
+ String buildGeneratedBy() { |
+ var suffix = ''; |
+ if (compiler.hasBuildId) suffix = ' version: ${compiler.buildId}'; |
+ return '// Generated by dart2js, the Dart to JavaScript compiler$suffix.\n'; |
+ } |
+ |
String buildSourceMap(CodeBuffer buffer, SourceFile compiledFile) { |
SourceMapBuilder sourceMapBuilder = |
new SourceMapBuilder(compiler.sourceMapUri); |
@@ -3214,10 +3220,6 @@ if (typeof document !== "undefined" && document.readyState !== "complete") { |
} |
} |
-const String GENERATED_BY = """ |
-// Generated by dart2js, the Dart to JavaScript compiler. |
-"""; |
- |
const String HOOKS_API_USAGE = """ |
// The code supports the following hooks: |
// dartPrint(message) - if this function is defined it is called |