Fix random.item to accomodate DOMStringList
This commit is contained in:
parent
a1aab62256
commit
2d36bb0739
1 changed files with 1 additions and 1 deletions
|
@ -50,7 +50,7 @@ var random = { // eslint-disable-line no-unused-vars
|
||||||
return Math.exp(this.float() * Math.log(limit))
|
return Math.exp(this.float() * Math.log(limit))
|
||||||
},
|
},
|
||||||
item: function (list) {
|
item: function (list) {
|
||||||
if (list === undefined || typeof list === 'string' || !list.hasOwnProperty('length')) {
|
if (list === undefined || typeof list === 'string' || list.length === undefined) {
|
||||||
logger.traceback()
|
logger.traceback()
|
||||||
throw new TypeError('random.item() received an invalid object: \'' + list + '\'')
|
throw new TypeError('random.item() received an invalid object: \'' + list + '\'')
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue