fix(tvix/eval): substring: propagate catchables

Change-Id: Ia9b7858c817fbc9c95a3d1c2855b2445f7830e8d
Reviewed-on: https://cl.tvl.fyi/c/depot/+/10326
Tested-by: BuildkiteCI
Autosubmit: Adam Joseph <adam@westernsemico.com>
Reviewed-by: tazjin <tazjin@tvl.su>
This commit is contained in:
Adam Joseph 2023-12-12 04:33:34 -08:00 committed by clbot
parent c5f58d4af3
commit 243a4b5699
3 changed files with 7 additions and 4 deletions

View file

@ -1002,10 +1002,11 @@ mod pure_builtins {
let beg = start.as_int()?;
let len = len.as_int()?;
let span = generators::request_span(&co).await;
let x = s
.coerce_to_string(co, CoercionKind::Weak, span)
.await?
.to_str()?;
let x = s.coerce_to_string(co, CoercionKind::Weak, span).await?;
if x.is_catchable() {
return Ok(x);
}
let x = x.to_str()?;
if beg < 0 {
return Err(ErrorKind::IndexOutOfBounds { index: beg });

View file

@ -0,0 +1 @@
(builtins.tryEval ( builtins.substring 0 4 (throw "jill") )).success