From 2d36bb0739ba9128c69350c940336e251e58300f Mon Sep 17 00:00:00 2001 From: pyoor Date: Thu, 20 Jul 2017 15:37:20 -0400 Subject: [PATCH] Fix random.item to accomodate DOMStringList --- lib/random/random.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/random/random.js b/lib/random/random.js index 9e482c1..3811eef 100644 --- a/lib/random/random.js +++ b/lib/random/random.js @@ -50,7 +50,7 @@ var random = { // eslint-disable-line no-unused-vars return Math.exp(this.float() * Math.log(limit)) }, item: function (list) { - if (list === undefined || typeof list === 'string' || !list.hasOwnProperty('length')) { + if (list === undefined || typeof list === 'string' || list.length === undefined) { logger.traceback() throw new TypeError('random.item() received an invalid object: \'' + list + '\'') }