mirror of
https://github.com/socketio/socket.io.git
synced 2026-01-12 00:17:56 -05:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
88b2cdb6ab | ||
|
|
d30630ba10 | ||
|
|
f927ba29ef |
@@ -1,3 +1,12 @@
|
||||
## [2.5.1](https://github.com/socketio/socket.io/compare/2.5.0...2.5.1) (2024-06-19)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add a noop handler for the error event ([d30630b](https://github.com/socketio/socket.io/commit/d30630ba10562bf987f4d2b42440fc41a828119c))
|
||||
|
||||
|
||||
|
||||
# [2.5.0](https://github.com/socketio/socket.io/compare/2.4.1...2.5.0) (2022-06-26)
|
||||
|
||||
|
||||
|
||||
@@ -49,6 +49,8 @@ var flags = [
|
||||
|
||||
var emit = Emitter.prototype.emit;
|
||||
|
||||
function noop() {}
|
||||
|
||||
/**
|
||||
* Interface to a `Client` for a given `Namespace`.
|
||||
*
|
||||
@@ -72,6 +74,9 @@ function Socket(nsp, client, query){
|
||||
this.fns = [];
|
||||
this.flags = {};
|
||||
this._rooms = [];
|
||||
|
||||
// prevents crash when the socket receives an "error" event without listener
|
||||
this.on('error', noop);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -427,12 +432,7 @@ Socket.prototype.ondisconnect = function(){
|
||||
*/
|
||||
|
||||
Socket.prototype.onerror = function(err){
|
||||
if (this.listeners('error').length) {
|
||||
this.emit('error', err);
|
||||
} else {
|
||||
console.error('Missing error handler on `socket`.');
|
||||
console.error(err.stack);
|
||||
}
|
||||
this.emit('error', err);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "socket.io",
|
||||
"version": "2.5.0",
|
||||
"version": "2.5.1",
|
||||
"description": "node.js realtime framework server",
|
||||
"keywords": [
|
||||
"realtime",
|
||||
|
||||
@@ -1858,7 +1858,7 @@ describe('socket.io', function(){
|
||||
it('should not crash when messing with Object prototype (and other globals)', function(done){
|
||||
Object.prototype.foo = 'bar';
|
||||
global.File = '';
|
||||
global.Blob = [];
|
||||
// global.Blob = [];
|
||||
var srv = http();
|
||||
var sio = io(srv);
|
||||
srv.listen(function(){
|
||||
|
||||
Reference in New Issue
Block a user