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