Mercurial > vim
comparison src/testdir/test_vim9_builtin.vim @ 26731:7f4cc4e58f75 v8.2.3894
patch 8.2.3894: Vim9: no proper type check for first argument of call()
Commit: https://github.com/vim/vim/commit/223d0a6bc8dc68039ceb6660de9576fafe178d73
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Dec 25 19:29:21 2021 +0000
patch 8.2.3894: Vim9: no proper type check for first argument of call()
Problem: Vim9: no proper type check for first argument of call().
Solution: Add specific type check.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 25 Dec 2021 20:30:03 +0100 |
parents | c04b28fad0cc |
children | 3aa38eaa5a11 |
comparison
equal
deleted
inserted
replaced
26730:fc326a1245cf | 26731:7f4cc4e58f75 |
---|---|
400 | 400 |
401 def Test_call_call() | 401 def Test_call_call() |
402 var l = [3, 2, 1] | 402 var l = [3, 2, 1] |
403 call('reverse', [l]) | 403 call('reverse', [l]) |
404 l->assert_equal([1, 2, 3]) | 404 l->assert_equal([1, 2, 3]) |
405 | |
406 CheckDefExecAndScriptFailure(['call(123, [2])'], 'E1256: String or function required for argument 1') | |
407 CheckDefExecAndScriptFailure(['call(true, [2])'], 'E1256: String or function required for argument 1') | |
405 CheckDefAndScriptFailure(['call("reverse", 2)'], ['E1013: Argument 2: type mismatch, expected list<any> but got number', 'E1211: List required for argument 2']) | 408 CheckDefAndScriptFailure(['call("reverse", 2)'], ['E1013: Argument 2: type mismatch, expected list<any> but got number', 'E1211: List required for argument 2']) |
406 CheckDefAndScriptFailure(['call("reverse", [2], [1])'], ['E1013: Argument 3: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 3']) | 409 CheckDefAndScriptFailure(['call("reverse", [2], [1])'], ['E1013: Argument 3: type mismatch, expected dict<any> but got list<number>', 'E1206: Dictionary required for argument 3']) |
407 enddef | 410 enddef |
408 | 411 |
409 def Test_ch_canread() | 412 def Test_ch_canread() |