summaryrefslogtreecommitdiffstats
path: root/src/typval.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/typval.c')
-rw-r--r--src/typval.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/typval.c b/src/typval.c
index e22dd3bbe2..61f8eb55b7 100644
--- a/src/typval.c
+++ b/src/typval.c
@@ -523,6 +523,17 @@ check_for_chan_or_job_arg(typval_T *args, int idx)
}
/*
+ * Give an error and return FAIL unless "args[idx]" is an optional channel or a
+ * job.
+ */
+ int
+check_for_opt_chan_or_job_arg(typval_T *args, int idx)
+{
+ return (args[idx].v_type == VAR_UNKNOWN
+ || check_for_chan_or_job_arg(args, idx) != FAIL);
+}
+
+/*
* Give an error and return FAIL unless "args[idx]" is a job.
*/
int