*/
module.exports.parser = _dereq_('engine.io-parser');
-},{"./socket":3,"engine.io-parser":14}],3:[function(_dereq_,module,exports){
+},{"./socket":3,"engine.io-parser":15}],3:[function(_dereq_,module,exports){
(function (global){
/**
* Module dependencies.
*/
var transports = _dereq_('./transports');
-var Emitter = _dereq_('emitter');
+var Emitter = _dereq_('component-emitter');
var debug = _dereq_('debug')('engine.io-client:socket');
var index = _dereq_('indexof');
var parser = _dereq_('engine.io-parser');
};
}).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-},{"./transport":4,"./transports":5,"debug":12,"emitter":13,"engine.io-parser":14,"indexof":22,"parsejson":24,"parseqs":25,"parseuri":26}],4:[function(_dereq_,module,exports){
+},{"./transport":4,"./transports":5,"component-emitter":12,"debug":14,"engine.io-parser":15,"indexof":23,"parsejson":24,"parseqs":25,"parseuri":26}],4:[function(_dereq_,module,exports){
/**
* Module dependencies.
*/
var parser = _dereq_('engine.io-parser');
-var Emitter = _dereq_('emitter');
+var Emitter = _dereq_('component-emitter');
/**
* Module exports.
* @api private
*/
-Transport.prototype.onData = function (data) {
- this.onPacket(parser.decodePacket(data, this.socket.binaryType));
+Transport.prototype.onData = function(data){
+ try {
+ var packet = parser.decodePacket(data, this.socket.binaryType);
+ this.onPacket(packet);
+ } catch(e){
+ e.data = data;
+ this.onError('parser decode error', e);
+ }
};
/**
this.emit('close');
};
-},{"emitter":13,"engine.io-parser":14}],5:[function(_dereq_,module,exports){
+},{"component-emitter":12,"engine.io-parser":15}],5:[function(_dereq_,module,exports){
(function (global){
/**
* Module dependencies
*/
var Polling = _dereq_('./polling');
-var inherit = _dereq_('inherits');
+var inherit = _dereq_('component-inherit');
/**
* Module exports.
this.script = script;
var isUAgecko = 'undefined' != typeof navigator && /gecko/i.test(navigator.userAgent);
-
+
if (isUAgecko) {
setTimeout(function () {
var iframe = document.createElement('iframe');
};
}).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-},{"./polling":8,"inherits":23}],7:[function(_dereq_,module,exports){
+},{"./polling":8,"component-inherit":13}],7:[function(_dereq_,module,exports){
(function (global){
/**
* Module requirements.
var XMLHttpRequest = _dereq_('xmlhttprequest');
var Polling = _dereq_('./polling');
-var Emitter = _dereq_('emitter');
+var Emitter = _dereq_('component-emitter');
+var inherit = _dereq_('component-inherit');
var debug = _dereq_('debug')('engine.io-client:polling-xhr');
-var inherit = _dereq_('inherits');
/**
* Module exports.
}
}).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-},{"./polling":8,"debug":12,"emitter":13,"inherits":23,"xmlhttprequest":10}],8:[function(_dereq_,module,exports){
+},{"./polling":8,"component-emitter":12,"component-inherit":13,"debug":14,"xmlhttprequest":10}],8:[function(_dereq_,module,exports){
/**
* Module dependencies.
*/
var Transport = _dereq_('../transport');
var parseqs = _dereq_('parseqs');
var parser = _dereq_('engine.io-parser');
+var inherit = _dereq_('component-inherit');
var debug = _dereq_('debug')('engine.io-client:polling');
-var inherit = _dereq_('inherits');
/**
* Module exports.
return schema + '://' + this.hostname + port + this.path + query;
};
-},{"../transport":4,"debug":12,"engine.io-parser":14,"inherits":23,"parseqs":25,"xmlhttprequest":10}],9:[function(_dereq_,module,exports){
+},{"../transport":4,"component-inherit":13,"debug":14,"engine.io-parser":15,"parseqs":25,"xmlhttprequest":10}],9:[function(_dereq_,module,exports){
/**
* Module dependencies.
*/
var Transport = _dereq_('../transport');
var parser = _dereq_('engine.io-parser');
var parseqs = _dereq_('parseqs');
+var inherit = _dereq_('component-inherit');
var debug = _dereq_('debug')('engine.io-client:websocket');
-var inherit = _dereq_('inherits');
/**
* `ws` exposes a WebSocket-compatible interface in
return !!WebSocket && !('__initialize' in WebSocket && this.name === WS.prototype.name);
};
-},{"../transport":4,"debug":12,"engine.io-parser":14,"inherits":23,"parseqs":25,"ws":27}],10:[function(_dereq_,module,exports){
+},{"../transport":4,"component-inherit":13,"debug":14,"engine.io-parser":15,"parseqs":25,"ws":27}],10:[function(_dereq_,module,exports){
// browser shim for xmlhttprequest module
var hasCORS = _dereq_('has-cors');
}).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{}],12:[function(_dereq_,module,exports){
-/**
- * Expose `debug()` as the module.
- */
-
-module.exports = debug;
-
-/**
- * Create a debugger with the given `name`.
- *
- * @param {String} name
- * @return {Type}
- * @api public
- */
-
-function debug(name) {
- if (!debug.enabled(name)) return function(){};
-
- return function(fmt){
- fmt = coerce(fmt);
-
- var curr = new Date;
- var ms = curr - (debug[name] || curr);
- debug[name] = curr;
-
- fmt = name
- + ' '
- + fmt
- + ' +' + debug.humanize(ms);
-
- // This hackery is required for IE8
- // where `console.log` doesn't have 'apply'
- window.console
- && console.log
- && Function.prototype.apply.call(console.log, console, arguments);
- }
-}
-
-/**
- * The currently active debug mode names.
- */
-
-debug.names = [];
-debug.skips = [];
-
-/**
- * Enables a debug mode by name. This can include modes
- * separated by a colon and wildcards.
- *
- * @param {String} name
- * @api public
- */
-
-debug.enable = function(name) {
- try {
- localStorage.debug = name;
- } catch(e){}
-
- var split = (name || '').split(/[\s,]+/)
- , len = split.length;
-
- for (var i = 0; i < len; i++) {
- name = split[i].replace('*', '.*?');
- if (name[0] === '-') {
- debug.skips.push(new RegExp('^' + name.substr(1) + '$'));
- }
- else {
- debug.names.push(new RegExp('^' + name + '$'));
- }
- }
-};
-
-/**
- * Disable debug output.
- *
- * @api public
- */
-
-debug.disable = function(){
- debug.enable('');
-};
-
-/**
- * Humanize the given `ms`.
- *
- * @param {Number} m
- * @return {String}
- * @api private
- */
-
-debug.humanize = function(ms) {
- var sec = 1000
- , min = 60 * 1000
- , hour = 60 * min;
-
- if (ms >= hour) return (ms / hour).toFixed(1) + 'h';
- if (ms >= min) return (ms / min).toFixed(1) + 'm';
- if (ms >= sec) return (ms / sec | 0) + 's';
- return ms + 'ms';
-};
-
-/**
- * Returns true if the given mode name is enabled, false otherwise.
- *
- * @param {String} name
- * @return {Boolean}
- * @api public
- */
-
-debug.enabled = function(name) {
- for (var i = 0, len = debug.skips.length; i < len; i++) {
- if (debug.skips[i].test(name)) {
- return false;
- }
- }
- for (var i = 0, len = debug.names.length; i < len; i++) {
- if (debug.names[i].test(name)) {
- return true;
- }
- }
- return false;
-};
-
-/**
- * Coerce `val`.
- */
-
-function coerce(val) {
- if (val instanceof Error) return val.stack || val.message;
- return val;
-}
-
-// persist
-
-try {
- if (window.localStorage) debug.enable(localStorage.debug);
-} catch(e){}
-
-},{}],13:[function(_dereq_,module,exports){
-
-/**
- * Module dependencies.
- */
-
-var index = _dereq_('indexof');
-
/**
* Expose `Emitter`.
*/
* @api public
*/
-Emitter.prototype.on = function(event, fn){
+Emitter.prototype.on =
+Emitter.prototype.addEventListener = function(event, fn){
this._callbacks = this._callbacks || {};
(this._callbacks[event] = this._callbacks[event] || [])
.push(fn);
fn.apply(this, arguments);
}
- fn._off = on;
+ on.fn = fn;
this.on(event, on);
return this;
};
Emitter.prototype.off =
Emitter.prototype.removeListener =
-Emitter.prototype.removeAllListeners = function(event, fn){
+Emitter.prototype.removeAllListeners =
+Emitter.prototype.removeEventListener = function(event, fn){
this._callbacks = this._callbacks || {};
// all
}
// remove specific handler
- var i = index(callbacks, fn._off || fn);
- if (~i) callbacks.splice(i, 1);
+ var cb;
+ for (var i = 0; i < callbacks.length; i++) {
+ cb = callbacks[i];
+ if (cb === fn || cb.fn === fn) {
+ callbacks.splice(i, 1);
+ break;
+ }
+ }
return this;
};
return !! this.listeners(event).length;
};
-},{"indexof":22}],14:[function(_dereq_,module,exports){
+},{}],13:[function(_dereq_,module,exports){
+
+module.exports = function(a, b){
+ var fn = function(){};
+ fn.prototype = b.prototype;
+ a.prototype = new fn;
+ a.prototype.constructor = a;
+};
+},{}],14:[function(_dereq_,module,exports){
+
+/**
+ * Expose `debug()` as the module.
+ */
+
+module.exports = debug;
+
+/**
+ * Create a debugger with the given `name`.
+ *
+ * @param {String} name
+ * @return {Type}
+ * @api public
+ */
+
+function debug(name) {
+ if (!debug.enabled(name)) return function(){};
+
+ return function(fmt){
+ fmt = coerce(fmt);
+
+ var curr = new Date;
+ var ms = curr - (debug[name] || curr);
+ debug[name] = curr;
+
+ fmt = name
+ + ' '
+ + fmt
+ + ' +' + debug.humanize(ms);
+
+ // This hackery is required for IE8
+ // where `console.log` doesn't have 'apply'
+ window.console
+ && console.log
+ && Function.prototype.apply.call(console.log, console, arguments);
+ }
+}
+
+/**
+ * The currently active debug mode names.
+ */
+
+debug.names = [];
+debug.skips = [];
+
+/**
+ * Enables a debug mode by name. This can include modes
+ * separated by a colon and wildcards.
+ *
+ * @param {String} name
+ * @api public
+ */
+
+debug.enable = function(name) {
+ try {
+ localStorage.debug = name;
+ } catch(e){}
+
+ var split = (name || '').split(/[\s,]+/)
+ , len = split.length;
+
+ for (var i = 0; i < len; i++) {
+ name = split[i].replace('*', '.*?');
+ if (name[0] === '-') {
+ debug.skips.push(new RegExp('^' + name.substr(1) + '$'));
+ }
+ else {
+ debug.names.push(new RegExp('^' + name + '$'));
+ }
+ }
+};
+
+/**
+ * Disable debug output.
+ *
+ * @api public
+ */
+
+debug.disable = function(){
+ debug.enable('');
+};
+
+/**
+ * Humanize the given `ms`.
+ *
+ * @param {Number} m
+ * @return {String}
+ * @api private
+ */
+
+debug.humanize = function(ms) {
+ var sec = 1000
+ , min = 60 * 1000
+ , hour = 60 * min;
+
+ if (ms >= hour) return (ms / hour).toFixed(1) + 'h';
+ if (ms >= min) return (ms / min).toFixed(1) + 'm';
+ if (ms >= sec) return (ms / sec | 0) + 's';
+ return ms + 'ms';
+};
+
+/**
+ * Returns true if the given mode name is enabled, false otherwise.
+ *
+ * @param {String} name
+ * @return {Boolean}
+ * @api public
+ */
+
+debug.enabled = function(name) {
+ for (var i = 0, len = debug.skips.length; i < len; i++) {
+ if (debug.skips[i].test(name)) {
+ return false;
+ }
+ }
+ for (var i = 0, len = debug.names.length; i < len; i++) {
+ if (debug.names[i].test(name)) {
+ return true;
+ }
+ }
+ return false;
+};
+
+/**
+ * Coerce `val`.
+ */
+
+function coerce(val) {
+ if (val instanceof Error) return val.stack || val.message;
+ return val;
+}
+
+// persist
+
+try {
+ if (window.localStorage) debug.enable(localStorage.debug);
+} catch(e){}
+
+},{}],15:[function(_dereq_,module,exports){
(function (global){
/**
* Module dependencies.
};
}).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-},{"./keys":15,"after":16,"arraybuffer.slice":17,"base64-arraybuffer":18,"blob":11,"utf8":19}],15:[function(_dereq_,module,exports){
+},{"./keys":16,"after":17,"arraybuffer.slice":18,"base64-arraybuffer":19,"blob":11,"utf8":20}],16:[function(_dereq_,module,exports){
/**
* Gets the keys for an object.
return arr;
};
-},{}],16:[function(_dereq_,module,exports){
+},{}],17:[function(_dereq_,module,exports){
module.exports = after
function after(count, callback, err_cb) {
function noop() {}
-},{}],17:[function(_dereq_,module,exports){
+},{}],18:[function(_dereq_,module,exports){
/**
* An abstraction for slicing an arraybuffer even when
* ArrayBuffer.prototype.slice is not supported
return result.buffer;
};
-},{}],18:[function(_dereq_,module,exports){
+},{}],19:[function(_dereq_,module,exports){
/*
* base64-arraybuffer
* https://github.com/niklasvh/base64-arraybuffer
};
})("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/");
-},{}],19:[function(_dereq_,module,exports){
+},{}],20:[function(_dereq_,module,exports){
(function (global){
/*! http://mths.be/utf8js v2.0.0 by @mathias */
;(function(root) {
}(this));
}).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-},{}],20:[function(_dereq_,module,exports){
-
-/**
- * Returns `this`. Execute this without a "context" (i.e. without it being
- * attached to an object of the left-hand side), and `this` points to the
- * "global" scope of the current JS execution.
- */
-
-module.exports = (function () { return this; })();
-
},{}],21:[function(_dereq_,module,exports){
/**
module.exports = false;
}
-},{"global":20}],22:[function(_dereq_,module,exports){
+},{"global":22}],22:[function(_dereq_,module,exports){
+
+/**
+ * Returns `this`. Execute this without a "context" (i.e. without it being
+ * attached to an object of the left-hand side), and `this` points to the
+ * "global" scope of the current JS execution.
+ */
+
+module.exports = (function () { return this; })();
+
+},{}],23:[function(_dereq_,module,exports){
var indexOf = [].indexOf;
}
return -1;
};
-},{}],23:[function(_dereq_,module,exports){
-if (typeof Object.create === 'function') {
- // implementation from standard node.js 'util' module
- module.exports = function inherits(ctor, superCtor) {
- ctor.super_ = superCtor
- ctor.prototype = Object.create(superCtor.prototype, {
- constructor: {
- value: ctor,
- enumerable: false,
- writable: true,
- configurable: true
- }
- });
- };
-} else {
- // old school shim for old browsers
- module.exports = function inherits(ctor, superCtor) {
- ctor.super_ = superCtor
- var TempCtor = function () {}
- TempCtor.prototype = superCtor.prototype
- ctor.prototype = new TempCtor()
- ctor.prototype.constructor = ctor
- }
-}
-
},{}],24:[function(_dereq_,module,exports){
(function (global){
/**
},{}]},{},[1])
(1)
-});
\ No newline at end of file
+});