(condition, msg)
| 1939 | |
| 1940 | // ---------- Assertion utils ---------- |
| 1941 | function assert(condition, msg) { |
| 1942 | if (!condition) throw new Error(msg || "assertion failed"); |
| 1943 | } |
| 1944 | function assertEq(a, b, msg) { |
| 1945 | if (a !== b) throw new Error(msg ? `${msg}: expected ${b}, got ${a}` : `expected ${b}, got ${a}`); |
| 1946 | } |