Skip to content
This repository has been archived by the owner on Feb 22, 2018. It is now read-only.

Commit

Permalink
feat(dccd): Make toString() code more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
vicb committed May 23, 2014
1 parent fb1bcf4 commit 47ad9d9
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions lib/change_detection/dirty_checking_change_detector.dart
Original file line number Diff line number Diff line change
Expand Up @@ -370,15 +370,15 @@ class _ChangeIterator<H> implements Iterator<Record<H>>{
* creates a single linked list of all of the changes for efficient traversal.
*/
class DirtyCheckingRecord<H> implements Record<H>, WatchRecord<H> {
static const List<String> _MODE_NAMES =
const ['MARKER',
'NOOP',
'IDENTITY',
'GETTER',
'GETTER / CLOSURE'
'MAP[]',
'ITERABLE',
'MAP'];
static const List<String> _MODE_NAMES = const [
'MARKER',
'NOOP',
'IDENTITY',
'GETTER',
'GETTER / CLOSURE'
'MAP[]',
'ITERABLE',
'MAP'];
static const int _MODE_MARKER_ = 0;
static const int _MODE_NOOP_ = 1;
static const int _MODE_IDENTITY_ = 2;
Expand Down Expand Up @@ -536,7 +536,8 @@ class DirtyCheckingRecord<H> implements Record<H>, WatchRecord<H> {
_group._recordRemove(this);
}

String toString() => '${_MODE_NAMES[_mode]}[$field]{$hashCode}';
String toString() =>
'${_mode < _MODE_NAMES.length ? _MODE_NAMES[_mode] : '?'}[$field]{$hashCode}';
}

final Object _INITIAL_ = new Object();
Expand Down

0 comments on commit 47ad9d9

Please sign in to comment.