fix(tvix/eval): builtins.getAttr: propagate catchables
Change-Id: I84b6b8f8568d57614a03aff0d6069e0bc27357bf Reviewed-on: https://cl.tvl.fyi/c/depot/+/10310 Reviewed-by: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI Autosubmit: Adam Joseph <adam@westernsemico.com>
This commit is contained in:
parent
afba150036
commit
8c8409c0d2
3 changed files with 8 additions and 0 deletions
|
@ -466,6 +466,12 @@ mod pure_builtins {
|
||||||
|
|
||||||
#[builtin("getAttr")]
|
#[builtin("getAttr")]
|
||||||
async fn builtin_get_attr(co: GenCo, key: Value, set: Value) -> Result<Value, ErrorKind> {
|
async fn builtin_get_attr(co: GenCo, key: Value, set: Value) -> Result<Value, ErrorKind> {
|
||||||
|
if key.is_catchable() {
|
||||||
|
return Ok(key);
|
||||||
|
}
|
||||||
|
if set.is_catchable() {
|
||||||
|
return Ok(set);
|
||||||
|
}
|
||||||
let k = key.to_str()?;
|
let k = key.to_str()?;
|
||||||
let xs = set.to_attrs()?;
|
let xs = set.to_attrs()?;
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
false
|
|
@ -0,0 +1 @@
|
||||||
|
(builtins.tryEval (builtins.getAttr (throw "fred") "bob")).success
|
Loading…
Reference in a new issue