Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7b9ae70

Browse filesBrowse files
Matt LoringFishrock123
authored andcommitted
benchmark: Fix crash in net benchmarks
Net benchmarks create partial event emitters that do not have all of the required event emitter functions. They currently mock out `on`, `once`, and `emit` functions. This change mocks out `prependListener` as well to avoid crashing in `_stream_readable`. PR-URL: https://www.github.com/nodejs/node/pull/6407 Fixes: https://www.github.com/nodejs/node/issues/6405 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Minwoo Jung <jmwsoft@gmail.com> Reviewed-By: Matthew Loring <mattloring@google.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 11e7cc5 commit 7b9ae70
Copy full SHA for 7b9ae70

File tree

Expand file treeCollapse file tree

4 files changed

+4
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

4 files changed

+4
-0
lines changed
Open diff view settings
Collapse file

‎benchmark/net/net-c2s-cork.js‎

Copy file name to clipboardExpand all lines: benchmark/net/net-c2s-cork.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ Writer.prototype.write = function(chunk, encoding, cb) {
6262
Writer.prototype.on = function() {};
6363
Writer.prototype.once = function() {};
6464
Writer.prototype.emit = function() {};
65+
Writer.prototype.prependListener = function() {};
6566

6667
function server() {
6768
var writer = new Writer();
Collapse file

‎benchmark/net/net-c2s.js‎

Copy file name to clipboardExpand all lines: benchmark/net/net-c2s.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ Writer.prototype.write = function(chunk, encoding, cb) {
6262
Writer.prototype.on = function() {};
6363
Writer.prototype.once = function() {};
6464
Writer.prototype.emit = function() {};
65+
Writer.prototype.prependListener = function() {};
6566

6667

6768
function Reader() {
Collapse file

‎benchmark/net/net-pipe.js‎

Copy file name to clipboardExpand all lines: benchmark/net/net-pipe.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ Writer.prototype.write = function(chunk, encoding, cb) {
6262
Writer.prototype.on = function() {};
6363
Writer.prototype.once = function() {};
6464
Writer.prototype.emit = function() {};
65+
Writer.prototype.prependListener = function() {};
6566

6667

6768
function Reader() {
Collapse file

‎benchmark/net/net-s2c.js‎

Copy file name to clipboardExpand all lines: benchmark/net/net-s2c.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ Writer.prototype.write = function(chunk, encoding, cb) {
6262
Writer.prototype.on = function() {};
6363
Writer.prototype.once = function() {};
6464
Writer.prototype.emit = function() {};
65+
Writer.prototype.prependListener = function() {};
6566

6667

6768
function Reader() {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.