revert: fix(change_detection): allow to destroy OnPush components inside of a host event

This reverts commit 280b86ec55.
This commit is contained in:
Matias Niemelä
2016-02-19 10:34:03 -08:00
parent 280b86ec55
commit b81b1fb81c
3 changed files with 2 additions and 38 deletions

View File

@ -174,7 +174,7 @@ export class ChangeDetectorJITGenerator {
var evalRecord = this._logic.genEventBindingEvalValue(eb, r);
var markPath = this._genMarkPathToRootAsCheckOnce(r);
var prevDefault = this._genUpdatePreventDefault(eb, r);
return `${markPath}\n${evalRecord}\n${prevDefault}`;
return `${evalRecord}\n${markPath}\n${prevDefault}`;
} else {
return this._logic.genEventBindingEvalValue(eb, r);
}

View File

@ -60,11 +60,9 @@ export class DynamicChangeDetector extends AbstractChangeDetector<any> {
if (proto.isSkipRecord()) {
protoIdx += this._computeSkipLength(protoIdx, proto, values);
} else {
if (proto.lastInBinding) {
this._markPathAsCheckOnce(proto);
}
var res = this._calculateCurrValue(proto, values, locals);
if (proto.lastInBinding) {
this._markPathAsCheckOnce(proto);
return res;
} else {
this._writeSelf(proto, res, values);