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

Unified Diff: samples/ui_lib/observable/ChangeEvent.dart

Issue 10943034: Issue 5162. Report error when initializing already initialized final field (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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
Index: samples/ui_lib/observable/ChangeEvent.dart
diff --git a/samples/ui_lib/observable/ChangeEvent.dart b/samples/ui_lib/observable/ChangeEvent.dart
index 8dcc0a08185af84dbadfe74733a24a748f0a74c1..41eabfd8696537ed3ae976eb3cc596c706986e1d 100644
--- a/samples/ui_lib/observable/ChangeEvent.dart
+++ b/samples/ui_lib/observable/ChangeEvent.dart
@@ -28,31 +28,33 @@ class ChangeEvent {
final int type;
/** The value after the change (or inserted value in a list). */
- final newValue = null;
+ final newValue;
/** The value before the change (or removed value from a list). */
- final oldValue = null;
+ final oldValue;
/** Property that changed (null for list changes). */
- final String propertyName = null;
+ final String propertyName;
/**
* Index of the list operation. Insertions prepend in front of the given
* index (insert at 0 means an insertion at the beginning of the list).
*/
- final int index = null;
+ final int index;
/** Factory constructor for property change events. */
ChangeEvent.property(
this.target, this.propertyName, this.newValue, this.oldValue)
- : type = UPDATE;
+ : type = UPDATE, index = null;
/** Factory constructor for list change events. */
ChangeEvent.list(
- this.target, this.type, this.index, this.newValue, this.oldValue);
+ this.target, this.type, this.index, this.newValue, this.oldValue)
+ : propertyName = null;
/** Factory constructor for [GLOBAL] change events. */
- ChangeEvent.global(this.target) : type = GLOBAL;
+ ChangeEvent.global(this.target)
+ : type = GLOBAL, newValue = null, oldValue = null, propertyName = null, index = null;
}
/** A collection of change events on a single observable instance. */
« no previous file with comments | « compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java ('k') | tests/co19/co19-compiler.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698