Fix logger
This commit is contained in:
parent
6cbda76fea
commit
68c04f6224
2 changed files with 7 additions and 7 deletions
|
@ -39,7 +39,7 @@ var random = {
|
|||
range: function (start, limit) {
|
||||
// Returns an integer in [start, limit]. Uniform distribution.
|
||||
if (isNaN(start) || isNaN(limit)) {
|
||||
logger.console.traceback()
|
||||
logger.traceback()
|
||||
throw new TypeError('random.range() received a non number type: \'' + start + '\', \'' + limit + '\')')
|
||||
}
|
||||
return this.number(limit - start + 1) + start
|
||||
|
@ -50,7 +50,7 @@ var random = {
|
|||
},
|
||||
item: function (list) {
|
||||
if (!(list instanceof Array || (list !== undefined && typeof list !== 'string' && list.hasOwnProperty('length')))) {
|
||||
logger.console.traceback()
|
||||
logger.traceback()
|
||||
throw new TypeError('this.item() received a non array type: \'' + list + '\'')
|
||||
}
|
||||
return list[this.number(list.length)]
|
||||
|
@ -86,7 +86,7 @@ var random = {
|
|||
},
|
||||
choose: function (list, flat) {
|
||||
if (!(list instanceof Array)) {
|
||||
logger.console.traceback()
|
||||
logger.traceback()
|
||||
throw new TypeError('random.choose() received a non-array type: \'' + list + '\'')
|
||||
}
|
||||
let total = 0
|
||||
|
@ -138,7 +138,7 @@ var random = {
|
|||
},
|
||||
subset: function (list, limit) {
|
||||
if (!(list instanceof Array)) {
|
||||
logger.console.traceback()
|
||||
logger.traceback()
|
||||
throw new TypeError('random.some() received a non-array type: \'' + list + '\'')
|
||||
}
|
||||
if (typeof limit !== 'number') {
|
||||
|
|
|
@ -26,7 +26,7 @@ Objects.prototype.add = function (category, member) {
|
|||
Objects.prototype.get = function (category, last) {
|
||||
if (!(category in this.container)) {
|
||||
// return {type:null, name:null};
|
||||
logger.console.traceback()
|
||||
logger.traceback()
|
||||
throw new Error(category + ' is not available.')
|
||||
}
|
||||
if (last) {
|
||||
|
@ -39,8 +39,8 @@ Objects.prototype.pick = function (category, last) {
|
|||
try {
|
||||
return this.get(category, last).name
|
||||
} catch (e) {
|
||||
logger.console.traceback()
|
||||
throw logger.console.JSError('Error: pick(' + category + ') ' + category + ' is undefined.')
|
||||
logger.traceback()
|
||||
throw logger.JSError('Error: pick(' + category + ') ' + category + ' is undefined.')
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue