diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-03-22 21:00:09 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-03-22 21:00:09 +0100 |
commit | e4eb6ff089e79e659acf33c17dd0fda7177de526 (patch) | |
tree | 910b326824ce60fea246dcf913735c61610b29d9 /src/testdir/test_partial.vim | |
parent | 6c0e984f263fc1eef42c9b34a80eff1bceb8d05b (diff) | |
download | vim-git-e4eb6ff089e79e659acf33c17dd0fda7177de526.tar.gz |
patch 7.4.1638v7.4.1638
Problem: When binding a function to a dict the reference count is wrong.
Solution: Decrement dict reference count, only reference the function when
actually making a copy. (Ken Takata)
Diffstat (limited to 'src/testdir/test_partial.vim')
-rw-r--r-- | src/testdir/test_partial.vim | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/testdir/test_partial.vim b/src/testdir/test_partial.vim index 3764f221f..f67bb41dd 100644 --- a/src/testdir/test_partial.vim +++ b/src/testdir/test_partial.vim @@ -170,3 +170,13 @@ func Test_partial_string() let F = function('MyFunc', ['foo'], d) call assert_equal("function('MyFunc', ['foo'], {'one': 1})", string(F)) endfunc + +func Test_func_unref() + let obj = {} + function! obj.func() abort + endfunction + let funcnumber = matchstr(string(obj.func), '^function(''\zs.\{-}\ze''') + call assert_true(exists('*{' . funcnumber . '}')) + unlet obj + call assert_false(exists('*{' . funcnumber . '}')) +endfunc |