enso/app/ide-desktop/debugGlobals.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
386 B
TypeScript
Raw Normal View History

/** @file Debug-only functions, injected or stripped by the build tool as appropriate. */
/** The logger used by {@link assert}. */
interface Logger {
error: (message: string) => void
}
/** Logs an error . */
export function assert(invariant: boolean, message: string, logger: Logger = console) {
if (!invariant) {
logger.error('assertion failed: ' + message)
}
}