Made JSLint happier.
window.clearTimeout(id);
};
};
+
/**
* The scheduler code that will run in the Worker.
*/
var _tasks = {};
self.onmessage = function(e) {
var cmd = e.data;
+ var id = _tasks[cmd.id];
switch (cmd.type) {
- case 'setTimeout': {
+ case 'setTimeout':
_tasks[cmd.id] = self.setTimeout(function() {
delete _tasks[cmd.id];
self.postMessage({
});
}, cmd.delay);
break;
- }
- case 'clearTimeout': {
- var id = _tasks[cmd.id];
+ case 'clearTimeout':
delete _tasks[cmd.id];
if (id) {
self.clearTimeout(id);
}
break;
- }
+ default:
+ throw 'Unknown command ' + cmd.type;
}
};
}
// [7] = port,
// [8] = uri,
// [9] = rest (query / fragment)
- return /(^https?:\/\/)?(((\[[^\]]+\])|([^:\/\?#]+))(:(\d+))?)?([^\?#]*)(.*)?/.exec(url);
+ return new RegExp('(^https?://)?(((\\[[^\\]]+])|([^:/?#]+))(:(\\d+))?)?([^?#]*)(.*)?').exec(url);
}
/**
_cometd._debug('Configuring cometd object with', configuration);
// Support old style param, where only the Bayeux server URL was passed.
if (_isString(configuration)) {
- configuration = { url: configuration };
+ configuration = {
+ url: configuration
+ };
}
if (!configuration) {
configuration = {};
// instead of being held by the server, so that connect listeners
// can be notified that the connection has been re-established
if (!_connected) {
- bayeuxMessage.advice = { timeout: 0 };
+ bayeuxMessage.advice = {
+ timeout: 0
+ };
}
_setStatus('connecting');
};
var ext = {
ext: {
- binary: {
- }
+ binary: {}
}
};
this.publish(channel, content, ext, callback);
};
var ext = {
ext: {
- binary: {
- }
+ binary: {}
}
};
