14 lines
370 B
JavaScript
14 lines
370 B
JavaScript
var _DEBUG = typeof DEBUG === 'undefined' ? false : DEBUG;
|
|
var _ASSERT = typeof ASSERT === 'undefined' ? false : ASSERT;
|
|
|
|
exports.debug = function() {
|
|
if (!_DEBUG) return;
|
|
console.log.apply(console, arguments);
|
|
};
|
|
|
|
exports.assert = function(statement, err, log) {
|
|
if (!_ASSERT) return;
|
|
if (statement) return;
|
|
log && console.log(log);
|
|
throw new Error(err);
|
|
}; |