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

Commit d75b4ab

Browse files
committed
Remove testingResults. No longer needed now that testing-only collectObservers is not used
R=arv BUG= Review URL: https://codereview.appspot.com/47200044
1 parent 3da7338 commit d75b4ab

File tree

1 file changed

+8
-18
lines changed

1 file changed

+8
-18
lines changed

src/observe.js

+8-18
Original file line numberDiff line numberDiff line change
@@ -383,11 +383,8 @@
383383
internalCallback_: function(records) {
384384
if (this.state_ != OPENED)
385385
return;
386-
if (this.reporting_ && this.check_(records)) {
386+
if (this.reporting_ && this.check_(records))
387387
this.report_();
388-
if (this.testingResults)
389-
this.testingResults.anyChanged = true;
390-
}
391388
},
392389

393390
close: function() {
@@ -402,7 +399,7 @@
402399
this.target_ = undefined;
403400
},
404401

405-
deliver: function(testingResults) {
402+
deliver: function() {
406403
if (this.state_ != OPENED)
407404
return;
408405

@@ -411,17 +408,12 @@
411408
return;
412409
}
413410

414-
this.testingResults = testingResults;
415411
if (this.deliverDirtyChecks_) {
416412
var anyChanged = dirtyCheck(this);
417-
if (testingResults)
418-
testingResults.anyChanged = testingResults.anyChanged || anyChanged;
419-
420413
this.reporting_ = false;
421414
}
422415

423416
Object.deliverChangeRecords(this.boundInternalCallback_);
424-
this.testingResults = undefined;
425417
this.reporting_ = true;
426418
},
427419

@@ -499,29 +491,27 @@
499491
runningMicrotaskCheckpoint = true;
500492

501493
var cycles = 0;
502-
var results = {};
494+
var anyChanged, toCheck;
503495

504496
do {
505497
cycles++;
506-
var toCheck = allObservers;
498+
toCheck = allObservers;
507499
allObservers = [];
508-
results.anyChanged = false;
500+
anyChanged = false;
509501

510502
for (var i = 0; i < toCheck.length; i++) {
511503
var observer = toCheck[i];
512504
if (observer.state_ != OPENED)
513505
continue;
514506

515-
if (hasObserve) {
516-
observer.deliver(results);
517-
} else if (observer.check_()) {
518-
results.anyChanged = true;
507+
if (observer.check_()) {
508+
anyChanged = true;
519509
observer.report_();
520510
}
521511

522512
allObservers.push(observer);
523513
}
524-
} while (cycles < MAX_DIRTY_CHECK_CYCLES && results.anyChanged);
514+
} while (cycles < MAX_DIRTY_CHECK_CYCLES && anyChanged);
525515

526516
if (global.testingExposeCycleCount)
527517
global.dirtyCheckCycleCount = cycles;

0 commit comments

Comments
 (0)