diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-12-25 21:43:28 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-12-25 21:43:28 +0000 |
commit | 1802405d71da20dff510690bf14f6da085836125 (patch) | |
tree | eb17c5e35f51aa31716d3222fd674d77b3629db7 /src/testdir/test_vim9_expr.vim | |
parent | db8e5c21b98c5998df4ab94e0b94bd9fdaf35c83 (diff) |
patch 8.2.3897: Vim9: second argument of map() and filter() not checkedv8.2.3897
Problem: Vim9: the second argument of map() and filter() is not checked at
compile time.
Solution: Add more specific type check for the second argument.
Diffstat (limited to 'src/testdir/test_vim9_expr.vim')
-rw-r--r-- | src/testdir/test_vim9_expr.vim | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/testdir/test_vim9_expr.vim b/src/testdir/test_vim9_expr.vim index 9cf035a618..01b4538508 100644 --- a/src/testdir/test_vim9_expr.vim +++ b/src/testdir/test_vim9_expr.vim @@ -2077,7 +2077,7 @@ def Test_expr7_lambda() ) assert_equal([111, 222, 111], ll) - var dl = [{key: 0}, {key: 22}]->filter(( _, v) => v['key'] ) + var dl = [{key: 0}, {key: 22}]->filter(( _, v) => !!v['key'] ) assert_equal([{key: 22}], dl) dl = [{key: 12}, {['foo']: 34}] @@ -2236,7 +2236,7 @@ def Test_expr7_new_lambda() ) assert_equal([111, 222, 111], ll) - var dl = [{key: 0}, {key: 22}]->filter(( _, v) => v['key'] ) + var dl = [{key: 0}, {key: 22}]->filter(( _, v) => !!v['key'] ) assert_equal([{key: 22}], dl) dl = [{key: 12}, {['foo']: 34}] @@ -2308,7 +2308,7 @@ def Test_expr7_lambda_vim9script() lines =<< trim END search('"', 'cW', 0, 0, () => synstack('.', col('.')) - ->map((_, v) => synIDattr(v, 'name'))->len()) + ->mapnew((_, v) => synIDattr(v, 'name'))->len()) END CheckDefAndScriptSuccess(lines) enddef |