fix(tvix/eval): builtins.length: propagate catchables
This commit fixes out builtins.length so it propagates catchables like cppnix does. Change-Id: I7670bec5eee1d4cd3f67a04c9a6808979fb56a8d Reviewed-on: https://cl.tvl.fyi/c/depot/+/10315 Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: Adam Joseph <adam@westernsemico.com> Tested-by: BuildkiteCI
This commit is contained in:
parent
331d9ee54a
commit
2565a21aa9
3 changed files with 5 additions and 0 deletions
|
@ -665,6 +665,9 @@ mod pure_builtins {
|
|||
|
||||
#[builtin("length")]
|
||||
async fn builtin_length(co: GenCo, list: Value) -> Result<Value, ErrorKind> {
|
||||
if list.is_catchable() {
|
||||
return Ok(list);
|
||||
}
|
||||
Ok(Value::Integer(list.to_list()?.len() as i64))
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
false
|
|
@ -0,0 +1 @@
|
|||
(builtins.tryEval (builtins.length (throw "fred"))).success
|
Loading…
Reference in a new issue