jrsonnet
jrsonnet copied to clipboard
std.mergePatch evaluates object
This snippet works differently compared to go-jsonnet/c-jsonnet:
std.mergePatch({ val: error 'should not error' }, {}) + { val+:: {} }
➜ jsonnet -e "std.mergePatch({ val: error 'should not error' }, {}) + { val+:: {} }"
{ }
➜ jrsonnet -e "std.mergePatch({ val: error 'should not error' }, {}) + { val+:: {} }"
runtime error: should not error
<cmdline>:1:23-48: error statement
<cmdline>:1:1-55: function <builtin_merge_patch> call
what about the sjsonnet?
what about the sjsonnet?
java -jar sjsonnet.jar -e "std.mergePatch({ val: error 'should not error' }, {}) + { val+:: {} }"
sjsonnet.Error: should not error
at [Error].(<exec>:1:23)
at [std.mergePatch].(<exec>:1:15)
at [BinaryOp +].(<exec>:1:55)
It also errors