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 beg = start.as_int()?;
|
||||||
let len = len.as_int()?;
|
let len = len.as_int()?;
|
||||||
let span = generators::request_span(&co).await;
|
let span = generators::request_span(&co).await;
|
||||||
let x = s
|
let x = s.coerce_to_string(co, CoercionKind::Weak, span).await?;
|
||||||
.coerce_to_string(co, CoercionKind::Weak, span)
|
if x.is_catchable() {
|
||||||
.await?
|
return Ok(x);
|
||||||
.to_str()?;
|
}
|
||||||
|
let x = x.to_str()?;
|
||||||
|
|
||||||
if beg < 0 {
|
if beg < 0 {
|
||||||
return Err(ErrorKind::IndexOutOfBounds { index: beg });
|
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