From 963ea4177eacb3bd9a74f2d91e67d22847d4cf34 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Wed, 25 Jul 2018 10:18:59 +0100 Subject: [PATCH] Add store arg to sync $flowContext/$globalContext --- red/api/editor/locales/en-US/jsonata.json | 4 ++-- red/runtime/util.js | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/red/api/editor/locales/en-US/jsonata.json b/red/api/editor/locales/en-US/jsonata.json index c839c759e..23917e749 100644 --- a/red/api/editor/locales/en-US/jsonata.json +++ b/red/api/editor/locales/en-US/jsonata.json @@ -189,11 +189,11 @@ "desc":"Returns an aggregated value derived from applying the `function` parameter successively to each value in `array` in combination with the result of the previous application of the function.\n\nThe function must accept two arguments, and behaves like an infix operator between each value within the `array`.\n\nThe optional `init` parameter is used as the initial value in the aggregation." }, "$flowContext": { - "args": "string", + "args": "string[, string]", "desc": "Retrieves a flow context property.\n\nThis is a Node-RED defined function." }, "$globalContext": { - "args": "string", + "args": "string[, string]", "desc": "Retrieves a global context property.\n\nThis is a Node-RED defined function." }, "$pad": { diff --git a/red/runtime/util.js b/red/runtime/util.js index d5643fcd5..d696f7f9a 100644 --- a/red/runtime/util.js +++ b/red/runtime/util.js @@ -389,11 +389,11 @@ function evaluateNodeProperty(value, type, node, msg, callback) { function prepareJSONataExpression(value,node) { var expr = jsonata(value); - expr.assign('flowContext',function(val) { - return node.context().flow.get(val); + expr.assign('flowContext',function(val, store) { + return node.context().flow.get(val, store); }); - expr.assign('globalContext',function(val) { - return node.context().global.get(val); + expr.assign('globalContext',function(val, store) { + return node.context().global.get(val, store); }); expr.assign('env', function(val) { return process.env[val];