mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	Add status capability to function node
This commit is contained in:
		@@ -57,6 +57,7 @@ module.exports = function(RED) {
 | 
				
			|||||||
                                 "error:__node__.error,"+
 | 
					                                 "error:__node__.error,"+
 | 
				
			||||||
                                 "warn:__node__.warn,"+
 | 
					                                 "warn:__node__.warn,"+
 | 
				
			||||||
                                 "on:__node__.on,"+
 | 
					                                 "on:__node__.on,"+
 | 
				
			||||||
 | 
					                                 "status:__node__.status,"+
 | 
				
			||||||
                                 "send:function(msgs){ __node__.send(__msgid__,msgs);}"+
 | 
					                                 "send:function(msgs){ __node__.send(__msgid__,msgs);}"+
 | 
				
			||||||
                              "};\n"+
 | 
					                              "};\n"+
 | 
				
			||||||
                              this.func+"\n"+
 | 
					                              this.func+"\n"+
 | 
				
			||||||
@@ -81,6 +82,9 @@ module.exports = function(RED) {
 | 
				
			|||||||
                },
 | 
					                },
 | 
				
			||||||
                on: function() {
 | 
					                on: function() {
 | 
				
			||||||
                    node.on.apply(node, arguments);
 | 
					                    node.on.apply(node, arguments);
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                status: function() {
 | 
				
			||||||
 | 
					                    node.status.apply(node, arguments);
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            },
 | 
					            },
 | 
				
			||||||
            context: {
 | 
					            context: {
 | 
				
			||||||
@@ -119,9 +123,9 @@ module.exports = function(RED) {
 | 
				
			|||||||
                            errorMessage = stack[line];
 | 
					                            errorMessage = stack[line];
 | 
				
			||||||
                            var m = /:(\d+):(\d+)$/.exec(stack[line+1]);
 | 
					                            var m = /:(\d+):(\d+)$/.exec(stack[line+1]);
 | 
				
			||||||
                            if (m) {
 | 
					                            if (m) {
 | 
				
			||||||
                                var line = Number(m[1])-1;
 | 
					                                var lineno = Number(m[1])-1;
 | 
				
			||||||
                                var cha = m[2];
 | 
					                                var cha = m[2];
 | 
				
			||||||
                                errorMessage += " (line "+line+", col "+cha+")";
 | 
					                                errorMessage += " (line "+lineno+", col "+cha+")";
 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user