UNPKG

ember-source

Version:

A JavaScript framework for creating ambitious web applications

20 lines (16 loc) 619 B
// import Logger from './logger'; function assert(test, msg) { } /** * This constant exists to make it easier to differentiate normal logs from * errant console.logs. LOGGER can be used outside of LOCAL_TRACE_LOGGING checks, * and is meant to be used in the rare situation where a console.* call is * actually appropriate. */ const LOGGER = console; function assertNever(value, desc = 'unexpected unreachable branch') { LOGGER.log('unreachable', value); LOGGER.log(`${desc} :: ${JSON.stringify(value)} (${value})`); throw new Error(`code reached unreachable`); } export { assert as a, assertNever as b };