Mercurial > vim
comparison src/testdir/test_vim9_func.vim @ 22496:454b78ca8247 v8.2.1796
patch 8.2.1796: Vim9: invalid memory access with weird function name
Commit: https://github.com/vim/vim/commit/7b5d5442696d86daab062592d5c86c829757c352
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Oct 4 13:42:34 2020 +0200
patch 8.2.1796: Vim9: invalid memory access with weird function name
Problem: Vim9: invalid memory access with weird function name. (Dhiraj
Mishra)
Solution: Check the name is valid. Add a test.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 04 Oct 2020 13:45:04 +0200 |
parents | 990b47e15cd7 |
children | 04a9b1399d8e |
comparison
equal
deleted
inserted
replaced
22495:f54613c0687b | 22496:454b78ca8247 |
---|---|
1904 TreeWalk('XclosureDir')->assert_equal(['file1', 'file2', {'tdir': ['file3']}]) | 1904 TreeWalk('XclosureDir')->assert_equal(['file1', 'file2', {'tdir': ['file3']}]) |
1905 | 1905 |
1906 delete('XclosureDir', 'rf') | 1906 delete('XclosureDir', 'rf') |
1907 enddef | 1907 enddef |
1908 | 1908 |
1909 def Test_invalid_function_name() | |
1910 var lines =<< trim END | |
1911 vim9script | |
1912 def s: list<string> | |
1913 END | |
1914 CheckScriptFailure(lines, 'E129:') | |
1915 | |
1916 lines =<< trim END | |
1917 vim9script | |
1918 def g: list<string> | |
1919 END | |
1920 CheckScriptFailure(lines, 'E129:') | |
1921 | |
1922 lines =<< trim END | |
1923 vim9script | |
1924 def <SID>: list<string> | |
1925 END | |
1926 CheckScriptFailure(lines, 'E884:') | |
1927 | |
1928 lines =<< trim END | |
1929 vim9script | |
1930 def F list<string> | |
1931 END | |
1932 CheckScriptFailure(lines, 'E488:') | |
1933 enddef | |
1934 | |
1909 def Test_partial_call() | 1935 def Test_partial_call() |
1910 var Xsetlist = function('setloclist', [0]) | 1936 var Xsetlist = function('setloclist', [0]) |
1911 Xsetlist([], ' ', {'title': 'test'}) | 1937 Xsetlist([], ' ', {'title': 'test'}) |
1912 getloclist(0, {'title': 1})->assert_equal({'title': 'test'}) | 1938 getloclist(0, {'title': 1})->assert_equal({'title': 'test'}) |
1913 | 1939 |