mirror of
https://github.com/vim/vim.git
synced 2025-10-25 09:04:09 -04:00
patch 8.2.3215: 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. Sort the argument lists.
(Yegappan Lakshmanan, closes #8626)
This commit is contained in:
committed by
Bram Moolenaar
parent
7d60384a00
commit
5bca906b30
@@ -179,6 +179,9 @@ invoke_sound_callback(void)
|
||||
static void
|
||||
sound_play_common(typval_T *argvars, typval_T *rettv, int playfile)
|
||||
{
|
||||
if (in_vim9script() && check_for_string_arg(argvars, 0) == FAIL)
|
||||
return;
|
||||
|
||||
if (context == NULL)
|
||||
ca_context_create(&context);
|
||||
if (context != NULL)
|
||||
@@ -351,6 +354,9 @@ f_sound_playevent(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
WCHAR *wp;
|
||||
|
||||
if (in_vim9script() && check_for_string_arg(argvars, 0) == FAIL)
|
||||
return;
|
||||
|
||||
wp = enc_to_utf16(tv_get_string(&argvars[0]), NULL);
|
||||
if (wp == NULL)
|
||||
return;
|
||||
@@ -371,6 +377,9 @@ f_sound_playfile(typval_T *argvars, typval_T *rettv)
|
||||
char buf[32];
|
||||
MCIERROR err;
|
||||
|
||||
if (in_vim9script() && check_for_string_arg(argvars, 0) == FAIL)
|
||||
return;
|
||||
|
||||
esc = vim_strsave_shellescape(tv_get_string(&argvars[0]), FALSE, FALSE);
|
||||
|
||||
len = STRLEN(esc) + 5 + 18 + 1;
|
||||
|
||||
Reference in New Issue
Block a user