Fix typo in random.subset: limit should only be randomized if it is not specified
This commit is contained in:
parent
b7d4cbd043
commit
8e084eb878
1 changed files with 2 additions and 2 deletions
|
@ -133,8 +133,8 @@ var random = {
|
||||||
Utils.traceback();
|
Utils.traceback();
|
||||||
throw new TypeError("random.some() received a non-array type: '" + list + "'");
|
throw new TypeError("random.some() received a non-array type: '" + list + "'");
|
||||||
}
|
}
|
||||||
if (typeof limit == 'number') {
|
if (typeof limit !== 'number') {
|
||||||
limit = this.range(0, list.length);
|
limit = this.number(list.length + 1);
|
||||||
}
|
}
|
||||||
let result = [];
|
let result = [];
|
||||||
for (let i = 0; i < limit; i++) {
|
for (let i = 0; i < limit; i++) {
|
||||||
|
|
Loading…
Reference in a new issue