Return true if `expr` is, or contains anywhere, an `Error` node.
(expr: MathJsonExpression | null | undefined)
| 3196 | // silently corrupting the value. Surface an error instead; the |
| 3197 | // intended nesting is written explicitly as `x^{2^3}`. |
| 3198 | if (nonEmptySuperscripts.length > 1) |
| 3199 | return this.error('unexpected-superscript', index); |
| 3200 | if (nonEmptySuperscripts.length !== 0) { |
| 3201 | const superscriptExpression: MathJsonExpression = |
| 3202 | nonEmptySuperscripts[0]; |
| 3203 | const arg: MathJsonExpression = [ |
| 3204 | 'Superscript', |
| 3205 | result!, |
| 3206 | superscriptExpression, |
| 3207 | ]; |