1 parent ba5d037 commit e02a291Copy full SHA for e02a291
1 file changed
lib/msgpack.js
@@ -24,8 +24,17 @@ var Stream = function(s) {
24
self.buf = null;
25
26
// Send a message down the stream
27
+ //
28
+ // Allows the caller to pass additional arguments, which are passed
29
+ // faithfully down to the write() method of the underlying stream.
30
self.send = function(m) {
- s.write(pack(m));
31
+ // Sigh, no arguments.slice() method
32
+ var args = [pack(m)];
33
+ for (i = 1; i < arguments.length; i++) {
34
+ args.push(arguments[i]);
35
+ }
36
+
37
+ s.write.apply(s, args);
38
};
39
40
// Listen for data from the underlying stream, consuming it and emitting
0 commit comments