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

Unified Diff: lib/src/compiler/code_generator.dart

Issue 1986693003: Provide option to suppress mirrors metadata (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Address comments Created 4 years, 7 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
« no previous file with comments | « lib/runtime/dart_sdk.js ('k') | lib/src/compiler/compiler.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/compiler/code_generator.dart
diff --git a/lib/src/compiler/code_generator.dart b/lib/src/compiler/code_generator.dart
index 8eea4be80d5297944d1d943d89ab9ad7a31a2008..4907417242f0031878e62dc7046daaa031ba3636 100644
--- a/lib/src/compiler/code_generator.dart
+++ b/lib/src/compiler/code_generator.dart
@@ -1148,9 +1148,8 @@ class CodeGenerator extends GeneralizingAstVisitor
void _emitClassMetadata(List<Annotation> metadata, JS.Expression className,
List<JS.Statement> body) {
- // TODO(vsm): Make this optional per #268.
// Metadata
- if (metadata.isNotEmpty) {
+ if (options.emitMetadata && metadata.isNotEmpty) {
body.add(js.statement('#[dart.metadata] = () => #;', [
className,
new JS.ArrayInitializer(
@@ -2222,8 +2221,7 @@ class CodeGenerator extends GeneralizingAstVisitor
parameters != null ? _parameterMetadata(parameters[i]) : [];
var typeName = _emitType(types[i]);
var value = typeName;
- // TODO(vsm): Make this optional per #268.
- if (metadata.isNotEmpty) {
+ if (options.emitMetadata && metadata.isNotEmpty) {
metadata = metadata.map(_instantiateAnnotation).toList();
value = new JS.ArrayInitializer([typeName]..addAll(metadata));
}
« no previous file with comments | « lib/runtime/dart_sdk.js ('k') | lib/src/compiler/compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698