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

Method setParent

src/core/context/node.js:309–314  ·  view source on GitHub ↗

* Sets (or unsets) the direct parent. If the parent is set, the node will no * longer try to discover itself. * * @param {?(ContextNode<?>|Node)} parent

(parent)

Source from the content-addressed store, hash-verified

307 * @param {?(ContextNode<?>|Node)} parent
308 */
309 setParent(parent) {
310 const parentContext = /** @type {*} */ (parent)?.nodeType
311 ? ContextNode.get(/** @type {Node} */ (parent))
312 : /** @type {?ContextNode<?>} */ (parent);
313 this.updateTree_(parentContext, /* parentOverridden */ parent != null);
314 }
315
316 /**
317 * Designates (or undesignates) the node as a root node. If the node is

Callers 3

addGroupMethod · 0.95
setParentFunction · 0.80

Calls 2

updateTree_Method · 0.95
getMethod · 0.45

Tested by

no test coverage detected