Mercurial > vim
diff src/eval.c @ 21831:d8422de73113 v8.2.1465
patch 8.2.1465: Vim9: subscript not handled properly
Commit: https://github.com/vim/vim/commit/56acb0943ede35cd9d2f6667cde2442819ccbf59
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Aug 16 14:48:19 2020 +0200
patch 8.2.1465: Vim9: subscript not handled properly
Problem: Vim9: subscript not handled properly.
Solution: Adjust error message. Remove dead code. Disallow string to
number conversion in scripts.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 16 Aug 2020 15:00:05 +0200 |
parents | af5db9b6d210 |
children | e3f9528bddda |
line wrap: on
line diff
--- a/src/eval.c +++ b/src/eval.c @@ -2142,7 +2142,9 @@ eval1(char_u **arg, typval_T *rettv, eva { 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)