1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Add status capability to function node

This commit is contained in:
Dave Conway-Jones 2015-10-15 13:33:01 +01:00
parent 4772bca14a
commit 0343de9f34

View File

@ -57,6 +57,7 @@ module.exports = function(RED) {
"error:__node__.error,"+
"warn:__node__.warn,"+
"on:__node__.on,"+
"status:__node__.status,"+
"send:function(msgs){ __node__.send(__msgid__,msgs);}"+
"};\n"+
this.func+"\n"+
@ -81,6 +82,9 @@ module.exports = function(RED) {
},
on: function() {
node.on.apply(node, arguments);
},
status: function() {
node.status.apply(node, arguments);
}
},
context: {
@ -119,9 +123,9 @@ module.exports = function(RED) {
errorMessage = stack[line];
var m = /:(\d+):(\d+)$/.exec(stack[line+1]);
if (m) {
var line = Number(m[1])-1;
var lineno = Number(m[1])-1;
var cha = m[2];
errorMessage += " (line "+line+", col "+cha+")";
errorMessage += " (line "+lineno+", col "+cha+")";
}
}
}