* @param {?ContextNode<?>} root * @protected Used cross-binary.
(root)
| 330 | * @protected Used cross-binary. |
| 331 | */ |
| 332 | updateRoot(root) { |
| 333 | devAssert(!root || root.isRoot); |
| 334 | const oldRoot = this.root; |
| 335 | if (root != oldRoot) { |
| 336 | // The root has changed. |
| 337 | this.root = root; |
| 338 | |
| 339 | // Make sure the tree changes have been reflected for values. |
| 340 | this.values.rootUpdated(); |
| 341 | |
| 342 | // Make sure the tree changes have been reflected for subscribers. |
| 343 | this.subscribers_?.forEach((comp) => comp.rootUpdated()); |
| 344 | |
| 345 | // Propagate the root to the subtree. |
| 346 | this.children?.forEach((child) => child.updateRoot(root)); |
| 347 | } |
| 348 | } |
| 349 | |
| 350 | /** |
| 351 | * @param {string} name |
no test coverage detected