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

Function parseNeverTrigger

packages/compiler/src/render3/r3_deferred_triggers.ts:64–89  ·  view source on GitHub ↗
(
  {expression, sourceSpan}: html.BlockParameter,
  triggers: t.DeferredBlockTriggers,
  errors: ParseError[],
)

Source from the content-addressed store, hash-verified

62
63/** Parses a `when` deferred trigger. */
64export function parseNeverTrigger(
65 {expression, sourceSpan}: html.BlockParameter,
66 triggers: t.DeferredBlockTriggers,
67 errors: ParseError[],
68): void {
69 const neverIndex = expression.indexOf('never');
70 const neverSourceSpan = new ParseSourceSpan(
71 sourceSpan.start.moveBy(neverIndex),
72 sourceSpan.start.moveBy(neverIndex + 'never'.length),
73 );
74 const prefetchSpan = getPrefetchSpan(expression, sourceSpan);
75 const hydrateSpan = getHydrateSpan(expression, sourceSpan);
76
77 // This is here just to be safe, we shouldn't enter this function
78 // in the first place if a block doesn't have the "on" keyword.
79 if (neverIndex === -1) {
80 errors.push(new ParseError(sourceSpan, `Could not find "never" keyword in expression`));
81 } else {
82 trackTrigger(
83 'never',
84 triggers,
85 errors,
86 new t.NeverDeferredTrigger(neverSourceSpan, sourceSpan, prefetchSpan, null, hydrateSpan),
87 );
88 }
89}
90
91/** Parses a `when` deferred trigger. */
92export function parseWhenTrigger(

Callers 1

parsePrimaryTriggersFunction · 0.90

Calls 6

getPrefetchSpanFunction · 0.85
getHydrateSpanFunction · 0.85
trackTriggerFunction · 0.85
indexOfMethod · 0.80
moveByMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…