0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.2.3173: Vim9: argument types are not checked at compile time

Problem:    Vim9: argument types are not checked at compile time.
Solution:   Add more type checks. (Yegappan Lakshmanan, closes #8581)
This commit is contained in:
Yegappan Lakshmanan
2021-07-17 19:11:07 +02:00
committed by Bram Moolenaar
parent 20c370d9f2
commit a9a7c0c602
11 changed files with 329 additions and 31 deletions

View File

@@ -3283,7 +3283,7 @@ f_diff_filler(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
f_diff_hlID(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
{
#ifdef FEAT_DIFF
linenr_T lnum = tv_get_lnum(argvars);
linenr_T lnum;
static linenr_T prev_lnum = 0;
static varnumber_T changedtick = 0;
static int fnum = 0;
@@ -3293,6 +3293,14 @@ f_diff_hlID(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
int filler_lines;
int col;
if (in_vim9script()
&& ((argvars[0].v_type != VAR_STRING
&& argvars[0].v_type != VAR_NUMBER
&& check_for_string_arg(argvars, 0) == FAIL)
|| check_for_number_arg(argvars, 1) == FAIL))
return;
lnum = tv_get_lnum(argvars);
if (lnum < 0) // ignore type error in {lnum} arg
lnum = 0;
if (lnum != prev_lnum