MCPcopy
hub / github.com/ampproject/amphtml / liveListTombstone

Function liveListTombstone

build-system/server/app.js:660–671  ·  view source on GitHub ↗

* @param {Element} liveList

(liveList)

Source from the content-addressed store, hash-verified

658 * @param {Element} liveList
659 */
660function liveListTombstone(liveList) {
661 const tombstoneId = Math.floor(Math.random() * itemCtr);
662 logWithoutTimestamp(`trying to tombstone #list-item-${tombstoneId}`);
663 // We can tombstone any list item except item-1 since we always do a
664 // replace example on item-1.
665 if (tombstoneId != 1) {
666 const item = liveList./*OK*/ querySelector(`#list-item-${tombstoneId}`);
667 if (item) {
668 item.setAttribute('data-tombstone', '');
669 }
670 }
671}
672
673/**
674 * Generate a random number between min and max

Callers 1

app.jsFile · 0.85

Calls 2

logWithoutTimestampFunction · 0.85
setAttributeMethod · 0.45

Tested by

no test coverage detected