A new regression has been identified in 8u40 b04. When running some of the http tests of avatar.js with this build of the jdk, emitted socket becomes undefined. For example, applying this diagnostic patch to http.js, and running the test test-http-timeout.js, we get this output - @@ -1725,9 +1725,11 @@ } ClientRequest.prototype.onSocket = function(socket) { + print('ClientRequest.prototype.onSocket ' + socket + ' type ' + (typeof socket)); var req = this; process.nextTick(function() { + print('ClientRequest.prototype.onSocket.nextTick ' + socket + ' type ' + (typeof socket)); var parser = parsers.alloc(); req.socket = socket; req.connection = socket; @@ -1755,6 +1757,7 @@ socket.onend = socketOnEnd; socket.on('close', socketCloseListener); parser.onIncoming = parserOnIncomingClient; + print('ClientRequest.prototype.onSocket.nextTick.emitting ' + socket + ' type ' + (typeof socket)); req.emit('socket', socket); }); java -jar dist/avatar-js.jar test/simple/test-http-timeout.js ClientRequest.prototype.onSocket [object Object] type object ClientRequest.prototype.onSocket.nextTick [object Object] type object ClientRequest.prototype.onSocket.nextTick.emitting [object Object] type object Exception in thread "main" TypeError: Cannot read property "setTimeout" from undefined in jar:file:/home/akhil/ws/avatar-js/dist/avatar-js.jar!/lib/http.js at line number 1822 at <anonymous> (jar:file:/home/akhil/ws/avatar-js/dist/avatar-js.jar!/lib/http.js:1822) at <anonymous> (jar:file:/home/akhil/ws/avatar-js/dist/avatar-js.jar!/lib/events.js:180) at <anonymous> (jar:file:/home/akhil/ws/avatar-js/dist/avatar-js.jar!/lib/events.js:117) at <anonymous> (jar:file:/home/akhil/ws/avatar-js/dist/avatar-js.jar!/lib/http.js:1761) Note that 'socket' is not undefined when emitted at http.js:1761, but becomes undefined at line http.js:1822. Perhaps the deep inheritance hierarchy is a factor? ClientRequest extends OutgoingMessage extends Stream extends EventEmitter.
|