Add context/flow/global support to Function node

This commit is contained in:
Nick O'Leary 2015-12-29 22:17:30 +00:00
parent 5ead3342cc
commit 742c470d81
1 changed files with 28 additions and 1 deletions

View File

@ -90,7 +90,34 @@ module.exports = function(RED) {
}
},
context: {
global:RED.settings.functionGlobalContext || {}
set: function() {
node.context().set.apply(node,arguments);
},
get: function() {
return node.context().get.apply(node,arguments);
},
get global() {
return node.context().global;
},
get flow() {
return node.context().flow;
}
},
flow: {
set: function() {
node.context().flow.set.apply(node,arguments);
},
get: function() {
return node.context().flow.get.apply(node,arguments);
}
},
global: {
set: function() {
node.context().global.set.apply(node,arguments);
},
get: function() {
return node.context().global.get.apply(node,arguments);
}
},
setTimeout: function () {
var func = arguments[0];