Allow the JSONata Expression to handle persistable store.

This commit is contained in:
HirokiUchikawa
2018-07-13 18:12:06 +09:00
parent d21e719cc1
commit adb0891335
2 changed files with 34 additions and 6 deletions

View File

@@ -408,9 +408,9 @@ function evaluateJSONataExpression(expr,msg,callback) {
if (callback) {
// If callback provided, need to override the pre-assigned sync
// context functions to be their async variants
bindings.flowContext = function(val) {
bindings.flowContext = function(val, store) {
return new Promise((resolve,reject) => {
expr._node.context().flow.get(val, function(err,value) {
expr._node.context().flow.get(val, store, function(err,value) {
if (err) {
reject(err);
} else {
@@ -419,9 +419,9 @@ function evaluateJSONataExpression(expr,msg,callback) {
})
});
}
bindings.globalContext = function(val) {
bindings.globalContext = function(val, store) {
return new Promise((resolve,reject) => {
expr._node.context().global.get(val, function(err,value) {
expr._node.context().global.get(val, store, function(err,value) {
if (err) {
reject(err);
} else {