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

Commit 47ad9d9

Browse files
committedMay 23, 2014
feat(dccd): Make toString() code more robust
1 parent fb1bcf4 commit 47ad9d9

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed
 

‎lib/change_detection/dirty_checking_change_detector.dart

+11-10
Original file line numberDiff line numberDiff line change
@@ -370,15 +370,15 @@ class _ChangeIterator<H> implements Iterator<Record<H>>{
370370
* creates a single linked list of all of the changes for efficient traversal.
371371
*/
372372
class DirtyCheckingRecord<H> implements Record<H>, WatchRecord<H> {
373-
static const List<String> _MODE_NAMES =
374-
const ['MARKER',
375-
'NOOP',
376-
'IDENTITY',
377-
'GETTER',
378-
'GETTER / CLOSURE'
379-
'MAP[]',
380-
'ITERABLE',
381-
'MAP'];
373+
static const List<String> _MODE_NAMES = const [
374+
'MARKER',
375+
'NOOP',
376+
'IDENTITY',
377+
'GETTER',
378+
'GETTER / CLOSURE'
379+
'MAP[]',
380+
'ITERABLE',
381+
'MAP'];
382382
static const int _MODE_MARKER_ = 0;
383383
static const int _MODE_NOOP_ = 1;
384384
static const int _MODE_IDENTITY_ = 2;
@@ -536,7 +536,8 @@ class DirtyCheckingRecord<H> implements Record<H>, WatchRecord<H> {
536536
_group._recordRemove(this);
537537
}
538538

539-
String toString() => '${_MODE_NAMES[_mode]}[$field]{$hashCode}';
539+
String toString() =>
540+
'${_mode < _MODE_NAMES.length ? _MODE_NAMES[_mode] : '?'}[$field]{$hashCode}';
540541
}
541542

542543
final Object _INITIAL_ = new Object();

0 commit comments

Comments
 (0)