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:
parent
c5f58d4af3
commit
243a4b5699
3 changed files with 7 additions and 4 deletions
|
@ -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 });
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
false
|
|
@ -0,0 +1 @@
|
|||
(builtins.tryEval ( builtins.substring 0 4 (throw "jill") )).success
|
Loading…
Reference in a new issue