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

Unified Diff: pkg/observe/lib/src/change_record.dart

Issue 50313004: Revert "Remove @deprecated features." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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/logging/test/logging_test.dart ('k') | pkg/observe/lib/src/observable.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/observe/lib/src/change_record.dart
diff --git a/pkg/observe/lib/src/change_record.dart b/pkg/observe/lib/src/change_record.dart
index c3cb3b5f1bafda66592fb1967b434e1748cfb266..bb584e8f427aa2e35f0e9dc612a774094e0c21c8 100644
--- a/pkg/observe/lib/src/change_record.dart
+++ b/pkg/observe/lib/src/change_record.dart
@@ -10,6 +10,13 @@ abstract class ChangeRecord {}
/** A change record to a field of an observable object. */
class PropertyChangeRecord<T> extends ChangeRecord {
+ /**
+ * *Deprecated* use [name] instead.
+ * The field that was changed.
+ */
+ @deprecated
+ Symbol get field => name;
+
/** The object that changed. */
final object;
@@ -24,6 +31,13 @@ class PropertyChangeRecord<T> extends ChangeRecord {
PropertyChangeRecord(this.object, this.name, this.oldValue, this.newValue);
+ /*
+ * *Deprecated* instead of `record.changes(key)` simply do
+ * `key == record.name`.
+ */
+ @deprecated
+ bool changes(key) => key is Symbol && name == key;
+
String toString() =>
'#<PropertyChangeRecord $name from: $oldValue to: $newValue>';
}
@@ -46,6 +60,13 @@ class ListChangeRecord extends ChangeRecord {
}
}
+ /**
+ * *Deprecated* use [indexChanged] instead.
+ * Returns true if the provided index was changed by this operation.
+ */
+ @deprecated
+ bool changes(value) => indexChanged(value);
+
/** Returns true if the provided index was changed by this operation. */
bool indexChanged(otherIndex) {
// If key isn't an int, or before the index, then it wasn't changed.
« no previous file with comments | « pkg/logging/test/logging_test.dart ('k') | pkg/observe/lib/src/observable.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698