MCPcopy Index your code
hub / github.com/ampproject/amphtml / scanAll

Method scanAll

src/core/context/values.js:321–345  ·  view source on GitHub ↗

* Used for `deepScan` scanner to notify the subtree to recalculate all * properties. * * Scans are relatively common and this method exists (as opposed to be * inlined) only to avoid frequent function allocation. * * @param {string[]} scheduled The already scheduled props. * @re

(scheduled)

Source from the content-addressed store, hash-verified

319 * @protected
320 */
321 scanAll(scheduled) {
322 /** @type {string[]?} */
323 let newScheduled = null;
324 const usedByKey = this.usedByKey_;
325 if (usedByKey) {
326 usedByKey.forEach((used) => {
327 const {prop} = used;
328 const {key} = prop;
329 // Only ping unhandled props.
330 if ((newScheduled || scheduled).indexOf(key) == -1) {
331 this.ping(prop, true);
332
333 if (this.contextNode_.children && this.has(prop)) {
334 if (!newScheduled) {
335 newScheduled = scheduled.slice(0);
336 }
337 // Stop the deepscan for this value. It will be propagated
338 // by the responsible node.
339 newScheduled.push(key);
340 }
341 }
342 });
343 }
344 return newScheduled || scheduled;
345 }
346
347 /**
348 * @return {boolean}

Callers 1

scanAllFunction · 0.80

Calls 4

pingMethod · 0.95
hasMethod · 0.95
forEachMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected