Skip to content

Commit 52e84e3

Browse files
committed
Have a test that shows try working further up the AST
1 parent 3424094 commit 52e84e3

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

suites/try.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,19 @@
4747
"rule": { "try": [{ "if": [{"val": ["user", "admin"]}, true, { "error": "Not an admin" }] }] },
4848
"data": { "user": { "admin": false } },
4949
"error": true
50+
},
51+
{
52+
"description": "Try can work further up the AST with Exceptions",
53+
"rule": {
54+
"try": [{
55+
"if": [
56+
true,
57+
{ "map": [[1,2,3], {"/": [0, 0] }]},
58+
null
59+
]
60+
}, 10]
61+
},
62+
"result": 10,
63+
"data": null
5064
}
5165
]

0 commit comments

Comments
 (0)