(v: Value | Control)
| 62 | } |
| 63 | |
| 64 | export function assertValue(v: Value | Control): asserts v is Value { |
| 65 | switch (v.type) { |
| 66 | case 'return': |
| 67 | throw new AiScriptRuntimeError('Invalid return'); |
| 68 | case 'break': |
| 69 | throw new AiScriptRuntimeError('Invalid break'); |
| 70 | case 'continue': |
| 71 | throw new AiScriptRuntimeError('Invalid continue'); |
| 72 | default: |
| 73 | v satisfies Value; |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | export function isControl(v: Value | Control | Reference): v is Control { |
| 78 | switch (v.type) { |
no outgoing calls
no test coverage detected