diff options
Diffstat (limited to '')
-rw-r--r-- | tvix/eval/docs/builtins.md | 2 | ||||
-rw-r--r-- | tvix/eval/src/builtins/mod.rs | 7 |
2 files changed, 4 insertions, 5 deletions
diff --git a/tvix/eval/docs/builtins.md b/tvix/eval/docs/builtins.md index 00af50484903..a232331896eb 100644 --- a/tvix/eval/docs/builtins.md +++ b/tvix/eval/docs/builtins.md @@ -64,7 +64,7 @@ The `impl` column indicates implementation status in tvix: | getContext | false | | | context | | getEnv | false | | false | | | hasAttr | false | | | | -| hasContext | false | | | context | +| hasContext | false | | | | | hashFile | false | | false | todo | | hashString | false | | | todo | | head | false | | | | diff --git a/tvix/eval/src/builtins/mod.rs b/tvix/eval/src/builtins/mod.rs index 341ee6096924..a79199339c13 100644 --- a/tvix/eval/src/builtins/mod.rs +++ b/tvix/eval/src/builtins/mod.rs @@ -551,10 +551,9 @@ mod pure_builtins { #[builtin("hasContext")] #[allow(non_snake_case)] - async fn builtin_hasContext(_co: GenCo, #[lazy] _e: Value) -> Result<Value, ErrorKind> { - Ok(Value::Catchable(CatchableErrorKind::UnimplementedFeature( - "hasContext".to_string(), - ))) + async fn builtin_hasContext(co: GenCo, e: Value) -> Result<Value, ErrorKind> { + let v = e.to_str()?; + Ok(Value::Bool(v.has_context())) } #[builtin("hashString")] |