summaryrefslogtreecommitdiffhomepage
path: root/lib.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2020-08-24 12:02:49 +0200
committerJo-Philipp Wich <jo@mein.io>2020-08-24 12:02:49 +0200
commit631000add6379cb08968746bbb46e98b939b8c99 (patch)
tree99263a56f60eebf23d740e18b4efb1432f4cba5e /lib.c
parent8a821177b01984715b42035186f562b5a427732e (diff)
eval.c, lib.c: allow invoking functions with existing scope
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib.c b/lib.c
index f9d1f49..30b7574 100644
--- a/lib.c
+++ b/lib.c
@@ -435,7 +435,7 @@ ut_filter(struct ut_state *s, struct ut_opcode *op, struct json_object *args)
json_object_array_put_idx(cmpargs, 0, json_object_get(json_object_array_get_idx(obj, arridx)));
json_object_array_put_idx(cmpargs, 1, json_object_new_int64(arridx));
- rv = ut_invoke(s, op, func, cmpargs);
+ rv = ut_invoke(s, op, NULL, func, cmpargs);
if (ut_val_is_truish(rv))
json_object_array_add(arr, json_object_get(json_object_array_get_idx(obj, arridx)));
@@ -622,7 +622,7 @@ ut_map(struct ut_state *s, struct ut_opcode *op, struct json_object *args)
json_object_array_put_idx(cmpargs, 0, json_object_get(json_object_array_get_idx(obj, arridx)));
json_object_array_put_idx(cmpargs, 1, json_object_new_int64(arridx));
- json_object_array_add(arr, ut_invoke(s, op, func, cmpargs));
+ json_object_array_add(arr, ut_invoke(s, op, NULL, func, cmpargs));
}
ut_putval(cmpargs);
@@ -779,7 +779,7 @@ sort_fn(const void *k1, const void *k2)
json_object_array_put_idx(sort_ctx.args, 0, *v1);
json_object_array_put_idx(sort_ctx.args, 1, *v2);
- rv = ut_invoke(sort_ctx.s, sort_ctx.op, sort_ctx.fn, sort_ctx.args);
+ rv = ut_invoke(sort_ctx.s, sort_ctx.op, NULL, sort_ctx.fn, sort_ctx.args);
ret = !ut_val_is_truish(rv);
ut_putval(rv);