Skip to content

Commit 659bb22

Browse files
committed
patch 8.2.1980: Vim9: some tests are not done at the script level
Problem: Vim9: some tests are not done at the script level. Solution: Use CheckDefAndScriptSuccess() in more places. Fix uncovered problems.
1 parent 47c5ea4 commit 659bb22

5 files changed

Lines changed: 734 additions & 721 deletions

File tree

src/eval.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3438,7 +3438,15 @@ eval7_leader(
34383438
}
34393439
#ifdef FEAT_FLOAT
34403440
if (rettv->v_type == VAR_FLOAT)
3441-
f = !f;
3441+
{
3442+
if (in_vim9script())
3443+
{
3444+
rettv->v_type = VAR_BOOL;
3445+
val = f == 0.0 ? VVAL_TRUE : VVAL_FALSE;
3446+
}
3447+
else
3448+
f = !f;
3449+
}
34423450
else
34433451
#endif
34443452
{

src/list.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1264,7 +1264,7 @@ eval_list(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int do_error)
12641264
had_comma = **arg == ',';
12651265
if (had_comma)
12661266
{
1267-
if (vim9script && !IS_WHITE_OR_NUL((*arg)[1]))
1267+
if (vim9script && !IS_WHITE_OR_NUL((*arg)[1]) && (*arg)[1] != ']')
12681268
{
12691269
semsg(_(e_white_space_required_after_str), ",");
12701270
goto failret;

src/scriptfile.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,7 +1332,10 @@ do_source(
13321332
// set again.
13331333
ht = &SCRIPT_VARS(sid);
13341334
if (is_vim9)
1335+
{
13351336
hashtab_free_contents(ht);
1337+
hash_init(ht);
1338+
}
13361339
else
13371340
{
13381341
int todo = (int)ht->ht_used;

0 commit comments

Comments
 (0)