Mercurial > vim
comparison src/list.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 |
comparison
equal
deleted
inserted
replaced
21830:bef87368c676 | 21831:d8422de73113 |
---|---|
1907 else | 1907 else |
1908 { | 1908 { |
1909 int error = FALSE; | 1909 int error = FALSE; |
1910 | 1910 |
1911 // filter(): when expr is zero remove the item | 1911 // filter(): when expr is zero remove the item |
1912 *remp = (tv_get_number_chk(&rettv, &error) == 0); | 1912 if (in_vim9script()) |
1913 *remp = !tv2bool(&rettv); | |
1914 else | |
1915 *remp = (tv_get_number_chk(&rettv, &error) == 0); | |
1913 clear_tv(&rettv); | 1916 clear_tv(&rettv); |
1914 // On type error, nothing has been removed; return FAIL to stop the | 1917 // On type error, nothing has been removed; return FAIL to stop the |
1915 // loop. The error message was given by tv_get_number_chk(). | 1918 // loop. The error message was given by tv_get_number_chk(). |
1916 if (error) | 1919 if (error) |
1917 goto theend; | 1920 goto theend; |