()
| 910 | return code; |
| 911 | } |
| 912 | optimizeNodes() { |
| 913 | super.optimizeNodes(); |
| 914 | const cond = this.condition; |
| 915 | if (cond === true) |
| 916 | return this.nodes; // else is ignored here |
| 917 | let e = this.else; |
| 918 | if (e) { |
| 919 | const ns = e.optimizeNodes(); |
| 920 | e = this.else = Array.isArray(ns) ? new Else(ns) : ns; |
| 921 | } |
| 922 | if (e) { |
| 923 | if (cond === false) |
| 924 | return e instanceof If ? e : e.nodes; |
| 925 | if (this.nodes.length) |
| 926 | return this; |
| 927 | return new If(not(cond), e instanceof If ? [e] : e.nodes); |
| 928 | } |
| 929 | if (cond === false || !this.nodes.length) |
| 930 | return undefined; |
| 931 | return this; |
| 932 | } |
| 933 | optimizeNames(names, constants) { |
| 934 | var _a; |
| 935 | this.else = (_a = this.else) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants); |
no test coverage detected