()
| 29 | } |
| 30 | |
| 31 | override execute(): TcbExpr { |
| 32 | const id = this.tcb.allocateId(); |
| 33 | let tagNames: string; |
| 34 | |
| 35 | if (this.element.tagNames.length === 1) { |
| 36 | tagNames = `"${this.element.tagNames[0]}"`; |
| 37 | } else { |
| 38 | tagNames = `null! as ${this.element.tagNames.map((t) => `"${t}"`).join(' | ')}`; |
| 39 | } |
| 40 | |
| 41 | const initializer = new TcbExpr(`document.createElement(${tagNames})`); |
| 42 | initializer.addParseSpanInfo(this.element.sourceSpan); |
| 43 | this.scope.addStatement(new TcbExpr(`var ${id} = ${initializer.print()}`)); |
| 44 | return new TcbExpr(id); |
| 45 | } |
| 46 | } |
nothing calls this directly
no test coverage detected