Mercurial > vim
comparison src/match.c @ 25302:4d3c68196d05 v8.2.3188
patch 8.2.3188: Vim9: argument types are not checked at compile time
Commit: https://github.com/vim/vim/commit/83494b4ac61898f687d6ef9dce4bad5802fb8e51
Author: Yegappan Lakshmanan <yegappan@yahoo.com>
Date: Tue Jul 20 17:51:51 2021 +0200
patch 8.2.3188: Vim9: argument types are not checked at compile time
Problem: Vim9: argument types are not checked at compile time.
Solution: Add several more type checks, also at runtime. (Yegappan
Lakshmanan, closes #8587)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 20 Jul 2021 18:00:06 +0200 |
parents | bb2e921d2601 |
children | 078edc1821bf |
comparison
equal
deleted
inserted
replaced
25301:fe178301fc04 | 25302:4d3c68196d05 |
---|---|
1043 #ifdef FEAT_SEARCH_EXTRA | 1043 #ifdef FEAT_SEARCH_EXTRA |
1044 list_T *l; | 1044 list_T *l; |
1045 listitem_T *li; | 1045 listitem_T *li; |
1046 dict_T *d; | 1046 dict_T *d; |
1047 list_T *s = NULL; | 1047 list_T *s = NULL; |
1048 win_T *win = get_optional_window(argvars, 1); | 1048 win_T *win; |
1049 | 1049 |
1050 rettv->vval.v_number = -1; | 1050 rettv->vval.v_number = -1; |
1051 | |
1052 if (in_vim9script() | |
1053 && (check_for_list_arg(argvars, 0) == FAIL | |
1054 || check_for_opt_number_arg(argvars, 1) == FAIL)) | |
1055 return; | |
1056 | |
1051 if (argvars[0].v_type != VAR_LIST) | 1057 if (argvars[0].v_type != VAR_LIST) |
1052 { | 1058 { |
1053 emsg(_(e_listreq)); | 1059 emsg(_(e_listreq)); |
1054 return; | 1060 return; |
1055 } | 1061 } |
1062 win = get_optional_window(argvars, 1); | |
1056 if (win == NULL) | 1063 if (win == NULL) |
1057 return; | 1064 return; |
1058 | 1065 |
1059 if ((l = argvars[0].vval.v_list) != NULL) | 1066 if ((l = argvars[0].vval.v_list) != NULL) |
1060 { | 1067 { |