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

Function consumeOpCode

packages/core/src/render3/i18n/i18n_debug.ts:80–97  ·  view source on GitHub ↗
(value: number)

Source from the content-addressed store, hash-verified

78 let lines: string[] = [];
79
80 function consumeOpCode(value: number): string {
81 const ref = value >>> I18nUpdateOpCode.SHIFT_REF;
82 const opCode = value & I18nUpdateOpCode.MASK_OPCODE;
83 switch (opCode) {
84 case I18nUpdateOpCode.Text:
85 return `(lView[${ref}] as Text).textContent = $$$`;
86 case I18nUpdateOpCode.Attr:
87 const attrName = parser.consumeString();
88 const sanitizationFn = parser.consumeFunction();
89 const value = sanitizationFn ? `(${sanitizationFn})($$$)` : '$$$';
90 return `(lView[${ref}] as Element).setAttribute('${attrName}', ${value})`;
91 case I18nUpdateOpCode.IcuSwitch:
92 return `icuSwitchCase(${ref}, $$$)`;
93 case I18nUpdateOpCode.IcuUpdate:
94 return `icuUpdateCase(${ref})`;
95 }
96 throw new Error('unexpected OpCode');
97 }
98
99 while (parser.hasMore()) {
100 let mask = parser.consumeNumber();

Callers 2

icuCreateOpCodesToStringFunction · 0.85

Calls 5

consumeStringMethod · 0.80
consumeFunctionMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…