0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.2.1011: Vim9: some code not tested

Problem:    Vim9: some code not tested.
Solution:   Add a few more test cases.  Reorder checks for clearer error.
            Remove unreachable code.
This commit is contained in:
Bram Moolenaar
2020-06-19 18:34:15 +02:00
parent 128d307963
commit c785b9a7f4
7 changed files with 32 additions and 21 deletions

View File

@@ -2886,10 +2886,6 @@ set_var_const(
return;
}
if (var_check_ro(di->di_flags, name, FALSE)
|| var_check_lock(di->di_tv.v_lock, name, FALSE))
return;
if (is_script_local
&& current_sctx.sc_version == SCRIPT_VERSION_VIM9)
{
@@ -2900,8 +2896,13 @@ set_var_const(
}
// check the type
check_script_var_type(&di->di_tv, tv, name);
if (check_script_var_type(&di->di_tv, tv, name) == FAIL)
return;
}
if (var_check_ro(di->di_flags, name, FALSE)
|| var_check_lock(di->di_tv.v_lock, name, FALSE))
return;
}
else
// can only redefine once