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

Commit

Permalink
fix(dccd): fix DirtyCheckingRecord.toString() throws an exception
Browse files Browse the repository at this point in the history
closes #1057
  • Loading branch information
vicb committed May 22, 2014
1 parent a355612 commit efcdca3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/change_detection/dirty_checking_change_detector.dart
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,14 @@ class _ChangeIterator<H> implements Iterator<Record<H>>{
*/
class DirtyCheckingRecord<H> implements Record<H>, WatchRecord<H> {
static const List<String> _MODE_NAMES =
const ['MARKER', 'IDENT', 'GETTER', 'MAP[]', 'ITERABLE', 'MAP'];
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

3 comments on commit efcdca3

@jbdeboer
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @vicb; any ideas for testing this bug?

@vicb
Copy link
Contributor Author

@vicb vicb commented on efcdca3 May 23, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jbdeboer I think there is no easy way to test with without refactoring - ie we can test the current _modes but there is no way to automatically pick new (or deleted) _modes.

I'll make the code more robust by making sure the _mode has a name before trying to print it. Still it could print a wrong name but I'm not sure it deserve to be unit tested (I'm not in favor of testing such things).

@vicb
Copy link
Contributor Author

@vicb vicb commented on efcdca3 May 23, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.