random tests succeed on Map :)

This commit is contained in:
Kevin Jahns
2015-07-06 23:04:01 +02:00
parent 9b6183ea70
commit e47dee53a3
7 changed files with 225 additions and 139 deletions

View File

@@ -1,17 +1,3 @@
// returns a random element of o
// works on Object, and Array
function getRandom (o) {
if (o instanceof Array) {
return o[Math.floor(Math.random() * o.length)];
} else if (o.constructor === Object) {
var keys = [];
for (var key in o) {
keys.push(key);
}
return o[getRandom(keys)];
}
}
var globalRoom = {
users: {},
buffers: {},
@@ -52,7 +38,7 @@ function flushOne(){
return false;
}
}
setInterval(flushOne, 10);
// setInterval(flushOne, 10);
var userIdCounter = 0;
@@ -85,6 +71,9 @@ class Test extends AbstractConnector {
c = flushOne();
}
}
flushOne() {
flushOne();
}
}
Y.Test = Test;