fix circ ref on error and error passing

This commit is contained in:
AJ ONeal 2015-08-27 16:07:31 -04:00
parent d92d164360
commit 1b5c723872
1 changed files with 3 additions and 2 deletions

View File

@ -79,7 +79,7 @@ function createApp(server, options) {
return; return;
} }
cmd.args.push(function () { cmd.args.push(function (err) {
var args = Array.prototype.slice.call(arguments); var args = Array.prototype.slice.call(arguments);
var myself; var myself;
@ -89,10 +89,11 @@ function createApp(server, options) {
} }
ws.send(JSON.stringify({ ws.send(JSON.stringify({
this: this this: (!err && this !== global) ? this : {}
, args: args , args: args
, self: myself , self: myself
, id: cmd.id , id: cmd.id
, error: err
})); }));
}); });