fix(change detection): preserve memoized results from pure functions

This commit is contained in:
Yegor Jbanov
2015-06-17 12:56:11 -07:00
parent b0e2ebda70
commit 5beaf6d735
5 changed files with 23 additions and 11 deletions

View File

@ -352,7 +352,7 @@ class _CodegenState {
if (r.isPureFunction()) {
// Add an "if changed guard"
var condition = r.args.map((a) => _changeNames[a]).join(' || ');
return 'if ($condition) { $check }';
return 'if ($condition) { $check } else { $newValue = $oldValue; }';
} else {
return check;
}