summaryrefslogtreecommitdiff
path: root/benchmark/net/net-s2c.js
diff options
context:
space:
mode:
authorMatt Loring <mattloring@google.com>2016-04-26 17:29:05 -0700
committerMatt Loring <mattloring@google.com>2016-04-27 17:06:08 -0700
commit89164a096d73da71562e09a18c5ce2b997f28513 (patch)
treebd6e92f3c01a4af2bfe27415f1929cf3f52acbc5 /benchmark/net/net-s2c.js
parent3cdb5063f20887a30101fe21748a4c4583255ce3 (diff)
downloadandroid-node-v8-89164a096d73da71562e09a18c5ce2b997f28513.tar.gz
android-node-v8-89164a096d73da71562e09a18c5ce2b997f28513.tar.bz2
android-node-v8-89164a096d73da71562e09a18c5ce2b997f28513.zip
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>
Diffstat (limited to 'benchmark/net/net-s2c.js')
-rw-r--r--benchmark/net/net-s2c.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/benchmark/net/net-s2c.js b/benchmark/net/net-s2c.js
index 2ef151f4ca..fc3f3e1389 100644
--- a/benchmark/net/net-s2c.js
+++ b/benchmark/net/net-s2c.js
@@ -62,6 +62,7 @@ Writer.prototype.write = function(chunk, encoding, cb) {
Writer.prototype.on = function() {};
Writer.prototype.once = function() {};
Writer.prototype.emit = function() {};
+Writer.prototype.prependListener = function() {};
function Reader() {