feat(change_detection): generate checkNoChanges only in dev mode

This commit is contained in:
vsavkin
2015-07-27 13:16:20 -07:00
parent a2bb81c406
commit 71bb4b3ee5
11 changed files with 68 additions and 31 deletions
@@ -23,7 +23,7 @@ export function main() {
beforeEach(() => {
proto = new SpyProtoChangeDetector();
def = new ChangeDetectorDefinition('id', null, [], [], []);
def = new ChangeDetectorDefinition('id', null, [], [], [], true);
});
it("should return a proto change detector when one is available", () => {
@@ -69,7 +69,7 @@ export function getDefinition(id: string): TestDefinition {
var bindingRecords = _createBindingRecords(id);
var directiveRecords = [];
let cdDef = new ChangeDetectorDefinition(id, strategy, variableBindings, bindingRecords,
directiveRecords);
directiveRecords, true);
testDef = new TestDefinition(id, cdDef, null);
}
if (isBlank(testDef)) {
@@ -107,7 +107,7 @@ class _ExpressionWithLocals {
var bindingRecords = _createBindingRecords(this._expression);
var directiveRecords = [];
return new ChangeDetectorDefinition('(empty id)', strategy, variableBindings, bindingRecords,
directiveRecords);
directiveRecords, true);
}
/**
@@ -151,7 +151,7 @@ class _ExpressionWithMode {
directiveRecords = [];
}
return new ChangeDetectorDefinition('(empty id)', this._strategy, variableBindings,
bindingRecords, directiveRecords);
bindingRecords, directiveRecords, true);
}
/**
@@ -174,7 +174,7 @@ class _DirectiveUpdating {
var variableBindings = [];
return new ChangeDetectorDefinition('(empty id)', strategy, variableBindings,
this._bindingRecords, this._directiveRecords);
this._bindingRecords, this._directiveRecords, true);
}
static updateA(expression: string, dirRecord): BindingRecord {
@@ -91,6 +91,8 @@ class _MyComponent_ChangeDetector0 extends _gen.AbstractChangeDetector {
_alreadyChecked = true;
}
void checkNoChanges() {this.runDetectChanges(true);}
void callOnAllChangesDone() {
dispatcher.notifyOnAllChangesDone();
}