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

Unified Diff: pkg/analyzer/tool/summary/generate.dart

Issue 2339053002: Change summaries setter generation to allow properties named 'value'. (Closed)
Patch Set: Created 4 years, 3 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 | « pkg/analyzer/lib/src/summary/format.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/tool/summary/generate.dart
diff --git a/pkg/analyzer/tool/summary/generate.dart b/pkg/analyzer/tool/summary/generate.dart
index b9616867146af987cc13a3be0efdbfac0ac31afc..39d920bc91c6e547867696567b7482abd6520919 100644
--- a/pkg/analyzer/tool/summary/generate.dart
+++ b/pkg/analyzer/tool/summary/generate.dart
@@ -568,19 +568,19 @@ class _CodeGenerator {
out();
outDoc(field.documentation);
constructorParams.add('$typeStr $fieldName');
- out('void set $fieldName($typeStr _value) {');
+ out('void set $fieldName($typeStr value) {');
indent(() {
String stateFieldName = '_' + fieldName;
// Validate that int(s) are non-negative.
if (fieldType.typeName == 'int') {
if (!fieldType.isList) {
- out('assert(_value == null || _value >= 0);');
+ out('assert(value == null || value >= 0);');
} else {
- out('assert(_value == null || _value.every((e) => e >= 0));');
+ out('assert(value == null || value.every((e) => e >= 0));');
}
}
// Set the value.
- out('$stateFieldName = _value;');
+ out('this.$stateFieldName = value;');
});
out('}');
}
« no previous file with comments | « pkg/analyzer/lib/src/summary/format.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698