|
383 | 383 | internalCallback_: function(records) {
|
384 | 384 | if (this.state_ != OPENED)
|
385 | 385 | return;
|
386 |
| - if (this.reporting_ && this.check_(records)) { |
| 386 | + if (this.reporting_ && this.check_(records)) |
387 | 387 | this.report_();
|
388 |
| - if (this.testingResults) |
389 |
| - this.testingResults.anyChanged = true; |
390 |
| - } |
391 | 388 | },
|
392 | 389 |
|
393 | 390 | close: function() {
|
|
402 | 399 | this.target_ = undefined;
|
403 | 400 | },
|
404 | 401 |
|
405 |
| - deliver: function(testingResults) { |
| 402 | + deliver: function() { |
406 | 403 | if (this.state_ != OPENED)
|
407 | 404 | return;
|
408 | 405 |
|
|
411 | 408 | return;
|
412 | 409 | }
|
413 | 410 |
|
414 |
| - this.testingResults = testingResults; |
415 | 411 | if (this.deliverDirtyChecks_) {
|
416 | 412 | var anyChanged = dirtyCheck(this);
|
417 |
| - if (testingResults) |
418 |
| - testingResults.anyChanged = testingResults.anyChanged || anyChanged; |
419 |
| - |
420 | 413 | this.reporting_ = false;
|
421 | 414 | }
|
422 | 415 |
|
423 | 416 | Object.deliverChangeRecords(this.boundInternalCallback_);
|
424 |
| - this.testingResults = undefined; |
425 | 417 | this.reporting_ = true;
|
426 | 418 | },
|
427 | 419 |
|
|
499 | 491 | runningMicrotaskCheckpoint = true;
|
500 | 492 |
|
501 | 493 | var cycles = 0;
|
502 |
| - var results = {}; |
| 494 | + var anyChanged, toCheck; |
503 | 495 |
|
504 | 496 | do {
|
505 | 497 | cycles++;
|
506 |
| - var toCheck = allObservers; |
| 498 | + toCheck = allObservers; |
507 | 499 | allObservers = [];
|
508 |
| - results.anyChanged = false; |
| 500 | + anyChanged = false; |
509 | 501 |
|
510 | 502 | for (var i = 0; i < toCheck.length; i++) {
|
511 | 503 | var observer = toCheck[i];
|
512 | 504 | if (observer.state_ != OPENED)
|
513 | 505 | continue;
|
514 | 506 |
|
515 |
| - if (hasObserve) { |
516 |
| - observer.deliver(results); |
517 |
| - } else if (observer.check_()) { |
518 |
| - results.anyChanged = true; |
| 507 | + if (observer.check_()) { |
| 508 | + anyChanged = true; |
519 | 509 | observer.report_();
|
520 | 510 | }
|
521 | 511 |
|
522 | 512 | allObservers.push(observer);
|
523 | 513 | }
|
524 |
| - } while (cycles < MAX_DIRTY_CHECK_CYCLES && results.anyChanged); |
| 514 | + } while (cycles < MAX_DIRTY_CHECK_CYCLES && anyChanged); |
525 | 515 |
|
526 | 516 | if (global.testingExposeCycleCount)
|
527 | 517 | global.dirtyCheckCycleCount = cycles;
|
|
0 commit comments