diff --git a/nodes/core/core/80-function.js b/nodes/core/core/80-function.js index 5eb96b1bf..224c1f8e2 100644 --- a/nodes/core/core/80-function.js +++ b/nodes/core/core/80-function.js @@ -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() { diff --git a/nodes/core/locales/en-US/messages.json b/nodes/core/locales/en-US/messages.json index c8c6bff1d..7d31ec2ab 100644 --- a/nodes/core/locales/en-US/messages.json +++ b/nodes/core/locales/en-US/messages.json @@ -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": {