mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Throw an error if a Function node adds an input event listener
This commit is contained in:
parent
59b34c2b3f
commit
2801838ffa
@ -83,6 +83,9 @@ module.exports = function(RED) {
|
||||
sendResults(node, id, msgs);
|
||||
},
|
||||
on: function() {
|
||||
if (arguments[0] === "input") {
|
||||
throw new Error(RED._("function.error.inputListener"));
|
||||
}
|
||||
node.on.apply(node, arguments);
|
||||
},
|
||||
status: function() {
|
||||
|
@ -141,6 +141,9 @@
|
||||
"function": "Function",
|
||||
"outputs": "Outputs"
|
||||
},
|
||||
"error": {
|
||||
"inputListener":"Cannot add listener to 'input' event within Function"
|
||||
},
|
||||
"tip": "See the Info tab for help writing functions."
|
||||
},
|
||||
"template": {
|
||||
|
Loading…
Reference in New Issue
Block a user