Skip to content

Commit

Permalink
fixed master call args
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Mar 24, 2011
1 parent e5385e8 commit 0ea4bd1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/master.js
Expand Up @@ -203,7 +203,7 @@ Master.prototype.__defineGetter__('environmentMatches', function(){

Master.prototype.call = function(id, method){
this.sock.write(utils.frame({
args: utils.toArray(arguments, 0)
args: utils.toArray(arguments, 2)
, method: method
, id: id
}), 'ascii');
Expand Down
2 changes: 1 addition & 1 deletion lib/utils.js
Expand Up @@ -30,7 +30,7 @@ exports.toArray = function(args, index){
var arr = []
, len = args.length;
for (var i = (index || 0); i < len; ++i) {
arr[i] = args[i];
arr.push(args[i]);
}
return arr;
};
Expand Down
2 changes: 1 addition & 1 deletion lib/worker.js
Expand Up @@ -67,7 +67,7 @@ Worker.prototype.start = function(){

// proxy to provide worker id
this.master.call = function(){
var args = Array.prototype.slice.call(arguments);
var args = utils.toArray(arguments);
args.unshift(self.id);
return call.apply(this, args);
};
Expand Down

0 comments on commit 0ea4bd1

Please sign in to comment.