MCPcopy Index your code
hub / github.com/angular/angular / describeExpectedDom

Function describeExpectedDom

packages/core/src/hydration/error_handling.ts:344–366  ·  view source on GitHub ↗

* Builds the string containing the expected DOM present given the LView and TNode * values for a readable error message * * @param lView the lView containing the DOM * @param tNode the tNode * @param isViewContainerAnchor boolean * @returns string

(lView: LView, tNode: TNode, isViewContainerAnchor: boolean)

Source from the content-addressed store, hash-verified

342 * @returns string
343 */
344function describeExpectedDom(lView: LView, tNode: TNode, isViewContainerAnchor: boolean): string {
345 const spacer = ' ';
346 let content = '';
347 if (tNode.prev) {
348 content += spacer + '…\n';
349 content += spacer + describeTNode(tNode.prev) + '\n';
350 } else if (tNode.type && tNode.type & TNodeType.AnyContainer) {
351 content += spacer + '…\n';
352 }
353 if (isViewContainerAnchor) {
354 content += spacer + describeTNode(tNode) + '\n';
355 content += spacer + `<!-- container --> ${AT_THIS_LOCATION}\n`;
356 } else {
357 content += spacer + describeTNode(tNode) + ` ${AT_THIS_LOCATION}\n`;
358 }
359 content += spacer + '…\n';
360
361 const parentRNode = tNode.type ? getParentRElement(lView[TVIEW], tNode, lView) : null;
362 if (parentRNode) {
363 content = describeRNode(parentRNode as unknown as Node, '\n' + content);
364 }
365 return content;
366}
367
368/**
369 * Builds the string containing the DOM present around a given RNode for a

Callers 3

validateMatchingNodeFunction · 0.85
validateNodeExistsFunction · 0.85
nodeNotFoundErrorFunction · 0.85

Calls 3

getParentRElementFunction · 0.90
describeTNodeFunction · 0.85
describeRNodeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…