summaryrefslogtreecommitdiff
path: root/src/typval.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/typval.c')
-rw-r--r--src/typval.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/typval.c b/src/typval.c
index 8b69adfcc..101f48f34 100644
--- a/src/typval.c
+++ b/src/typval.c
@@ -533,6 +533,23 @@ check_for_dict_arg(typval_T *args, int idx)
}
/*
+ * Give an error and return FAIL unless "args[idx]" is a non-NULL dict.
+ */
+ int
+check_for_nonnull_dict_arg(typval_T *args, int idx)
+{
+ if (check_for_dict_arg(args, idx) == FAIL)
+ return FAIL;
+
+ if (args[idx].vval.v_dict == NULL)
+ {
+ semsg(_(e_non_null_dict_required_for_argument_nr), idx + 1);
+ return FAIL;
+ }
+ return OK;
+}
+
+/*
* Check for an optional dict argument at 'idx'
*/
int
@@ -1179,7 +1196,7 @@ typval_compare(
if (type_is && tv1->v_type != tv2->v_type)
{
- // For "is" a different type always means FALSE, for "notis"
+ // For "is" a different type always means FALSE, for "isnot"
// it means TRUE.
n1 = (type == EXPR_ISNOT);
}