* @param {!Element} target * @param {number} index * @param {?boolean} value * @param {?Array<!ObserverCallbackDef>} callbacks * @private
(target, index, value, callbacks)
| 376 | * @private |
| 377 | */ |
| 378 | setObservation_(target, index, value, callbacks) { |
| 379 | let observations = this.targetObservations_.get(target); |
| 380 | if (!observations) { |
| 381 | const observers = this.observers_; |
| 382 | observations = new Array(observers.length); |
| 383 | for (let i = 0; i < observers.length; i++) { |
| 384 | observations[i] = observers[i].io ? null : false; |
| 385 | } |
| 386 | this.targetObservations_.set(target, observations); |
| 387 | } |
| 388 | |
| 389 | if (callbacks) { |
| 390 | const oldDisplay = computeDisplay(observations, this.isDocDisplay_); |
| 391 | observations[index] = value; |
| 392 | const newDisplay = computeDisplay(observations, this.isDocDisplay_); |
| 393 | notifyIfChanged(callbacks, target, newDisplay, oldDisplay); |
| 394 | } else { |
| 395 | observations[index] = value; |
| 396 | } |
| 397 | } |
| 398 | } |
| 399 | |
| 400 | /** |
no test coverage detected