MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / parseEndElement

Method parseEndElement

packages/core/ui/builder/index.ts:544–561  ·  view source on GitHub ↗
(prefix: string, elementName: string)

Source from the content-addressed store, hash-verified

542 }
543
544 private parseEndElement(prefix: string, elementName: string) {
545 if (this._state === TemplateParser.State.EXPECTING_START) {
546 throw new Error('Template must have exactly one root element but none was found.');
547 } else if (this._state === TemplateParser.State.FINISHED) {
548 throw new Error('No more closing elements expected for this template.');
549 }
550
551 this._nestingLevel--;
552
553 if (this._nestingLevel === 0) {
554 this._state = TemplateParser.State.FINISHED;
555
556 if (this._setTemplateProperty && this._templateProperty.name in this._templateProperty.parent.component) {
557 const template = this.buildTemplate();
558 this._templateProperty.parent.component[this._templateProperty.name] = template;
559 }
560 }
561 }
562
563 public buildTemplate(): Template {
564 if (__UI_USE_XML_PARSER__) {

Callers 1

parseMethod · 0.95

Calls 1

buildTemplateMethod · 0.95

Tested by

no test coverage detected