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

Method visitExpansion

packages/compiler/src/i18n/extractor_merger.ts:162–190  ·  view source on GitHub ↗
(icu: html.Expansion, context: any)

Source from the content-addressed store, hash-verified

160 }
161
162 visitExpansion(icu: html.Expansion, context: any): html.Expansion {
163 this._mayBeAddBlockChildren(icu);
164
165 const wasInIcu = this._inIcu;
166
167 if (!this._inIcu) {
168 // nested ICU messages should not be extracted but top-level translated as a whole
169 if (this._isInTranslatableSection) {
170 this._addMessage([icu]);
171 }
172 this._inIcu = true;
173 }
174
175 const cases = html.visitAll(this, icu.cases, context);
176
177 if (this._mode === _VisitorMode.Merge) {
178 icu = new html.Expansion(
179 icu.switchValue,
180 icu.type,
181 cases,
182 icu.sourceSpan,
183 icu.switchValueSourceSpan,
184 );
185 }
186
187 this._inIcu = wasInIcu;
188
189 return icu;
190 }
191
192 visitComment(comment: html.Comment, context: any): any {
193 const isOpening = _isOpeningComment(comment);

Callers

nothing calls this directly

Calls 3

_addMessageMethod · 0.95
visitAllMethod · 0.45

Tested by

no test coverage detected