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

Unified Diff: lib/transformer.dart

Issue 1616953004: Fixed strong mode errors and warnings reachable from lib/observe.dart (Closed) Base URL: https://github.com/dart-lang/observe.git@master
Patch Set: Removed inferrable type param Created 4 years, 11 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/src/path_observer.dart ('k') | pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/transformer.dart
diff --git a/lib/transformer.dart b/lib/transformer.dart
index 52b4987054c3fff64d27163f14bbd28ecd9ed6ae..20e8f1d6973ed40db7627e7a7ca5a7856dd390ba 100644
--- a/lib/transformer.dart
+++ b/lib/transformer.dart
@@ -133,9 +133,9 @@ bool _hasObservable(AnnotatedNode node) =>
// that is expensive in analyzer, so it isn't feasible yet.
bool _isObservableAnnotation(Annotation node) =>
_isAnnotationContant(node, 'observable') ||
- _isAnnotationContant(node, 'published') ||
- _isAnnotationType(node, 'ObservableProperty') ||
- _isAnnotationType(node, 'PublishedProperty');
+ _isAnnotationContant(node, 'published') ||
+ _isAnnotationType(node, 'ObservableProperty') ||
+ _isAnnotationType(node, 'PublishedProperty');
bool _isAnnotationContant(Annotation m, String name) =>
m.name.name == name && m.constructorName == null && m.arguments == null;
@@ -263,7 +263,6 @@ String _getOriginalCode(TextEditTransaction code, AstNode node) =>
void _fixConstructor(ConstructorDeclaration ctor, TextEditTransaction code,
Set<String> changedFields) {
-
// Fix normal initializers
for (var initializer in ctor.initializers) {
if (initializer is ConstructorFieldInitializer) {
@@ -392,7 +391,10 @@ void _transformFields(SourceFile file, FieldDeclaration member,
final end = _findFieldSeperator(field.endToken.next);
if (end.type == TokenType.COMMA) code.edit(end.offset, end.end, ';');
- code.edit(end.end, end.end, ' @reflectable set $name($type value) { '
+ code.edit(
+ end.end,
+ end.end,
+ ' @reflectable set $name($type value) { '
'__\$$name = notifyPropertyChange(#$name, __\$$name, value); }');
}
}
« no previous file with comments | « lib/src/path_observer.dart ('k') | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698