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

Unified Diff: pkg/compiler/lib/src/js_emitter/full_emitter/emitter.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 side-by-side diff with in-line comments
Download patch
Index: pkg/compiler/lib/src/js_emitter/full_emitter/emitter.dart
diff --git a/pkg/compiler/lib/src/js_emitter/full_emitter/emitter.dart b/pkg/compiler/lib/src/js_emitter/full_emitter/emitter.dart
index 60382c168c88685200eede50b1df1a4b7a497afb..319bc7219dfab50f3830feddbb674bf4c602fe50 100644
--- a/pkg/compiler/lib/src/js_emitter/full_emitter/emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/full_emitter/emitter.dart
@@ -12,6 +12,8 @@ import 'package:js_runtime/shared/embedded_names.dart' show
JsBuiltin,
JsGetName;
+import '../headers.dart';
+
import '../js_emitter.dart' hide Emitter;
import '../js_emitter.dart' as js_emitter show Emitter;
@@ -2072,11 +2074,10 @@ function(originalDescriptor, name, holder, isStatic, globalFunctionsAccess) {
}
jsAst.Comment buildGeneratedBy() {
- String suffix = '';
- if (compiler.hasBuildId) suffix = ' version: ${compiler.buildId}';
- String msg = '// Generated by dart2js, the Dart to JavaScript '
- 'compiler$suffix.';
- return new jsAst.Comment(msg);
+ List<String> options = [];
+ if (compiler.mirrorsLibrary != null) options.add('mirrors');
+ if (compiler.useContentSecurityPolicy) options.add("CSP");
+ return new jsAst.Comment(generatedBy(compiler, flavor: options.join(", ")));
}
void outputSourceMap(CodeOutput output,
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/full_emitter/declarations.dart ('k') | pkg/compiler/lib/src/js_emitter/headers.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698