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