diff options
Diffstat (limited to 'ext')
-rw-r--r-- | ext/console/01_console.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ext/console/01_console.js b/ext/console/01_console.js index ddc8daf00..d5ed80a63 100644 --- a/ext/console/01_console.js +++ b/ext/console/01_console.js @@ -147,6 +147,12 @@ function getNoColor() { return noColor; } +function assert(cond, msg = "Assertion failed.") { + if (!cond) { + throw new AssertionError(msg); + } +} + // Don't use 'blue' not visible on cmd.exe const styles = { special: "cyan", |