summaryrefslogtreecommitdiffstats
path: root/src/eval.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-08-16 14:48:19 +0200
committerBram Moolenaar <Bram@vim.org>2020-08-16 14:48:19 +0200
commit56acb0943ede35cd9d2f6667cde2442819ccbf59 (patch)
treed35aa5928ec6d46f07ea1ed4f1e5fb2f00bfa7dc /src/eval.c
parent829ac868b7615d73dbfb536f7fcd44fc7c5b7c1d (diff)
patch 8.2.1465: Vim9: subscript not handled properlyv8.2.1465
Problem: Vim9: subscript not handled properly. Solution: Adjust error message. Remove dead code. Disallow string to number conversion in scripts.
Diffstat (limited to 'src/eval.c')
-rw-r--r--src/eval.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/eval.c b/src/eval.c
index 8f685eda47..02b5623fc6 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -2142,7 +2142,9 @@ eval1(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
{
int error = FALSE;
- if (tv_get_number_chk(rettv, &error) != 0)
+ if (in_vim9script())
+ result = tv2bool(rettv);
+ else if (tv_get_number_chk(rettv, &error) != 0)
result = TRUE;
clear_tv(rettv);
if (error)