about summary refs log tree commit diff
path: root/tvix/eval/src/builtins
diff options
context:
space:
mode:
authorAdam Joseph <adam@westernsemico.com>2023-12-12T10·58-0800
committerclbot <clbot@tvl.fyi>2023-12-12T17·21+0000
commit012b44244bd75ad3480141debda6011370195c2b (patch)
tree3fcd08ddff19160b6ae369718e197698acd41a40 /tvix/eval/src/builtins
parent531f0c0c42246027ed4c6c76e37737dc67228544 (diff)
feat(tvix/eval): builtins.hasContext: placeholder implementation r/7195
Currently this just `throw`s a message explaining that it is not
implemented.  This is necessary in order to allow enumerating the
nixpkgs release attrset (afaict only one package uses this builtin).

Change-Id: I45266d46af579ddb5856b192b6be4b481369543c
Reviewed-on: https://cl.tvl.fyi/c/depot/+/10302
Autosubmit: Adam Joseph <adam@westernsemico.com>
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
Diffstat (limited to 'tvix/eval/src/builtins')
-rw-r--r--tvix/eval/src/builtins/mod.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/tvix/eval/src/builtins/mod.rs b/tvix/eval/src/builtins/mod.rs
index 181ddeed82e8..b7649e7995ed 100644
--- a/tvix/eval/src/builtins/mod.rs
+++ b/tvix/eval/src/builtins/mod.rs
@@ -498,6 +498,14 @@ mod pure_builtins {
         Ok(Value::Bool(xs.contains(k.as_str())))
     }
 
+    #[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(),
+        )))
+    }
+
     #[builtin("head")]
     async fn builtin_head(co: GenCo, list: Value) -> Result<Value, ErrorKind> {
         match list.to_list()?.get(0) {