1
0
forked from aniani/vim

patch 7.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)
This commit is contained in:
Bram Moolenaar
2016-03-22 21:00:09 +01:00
parent 6c0e984f26
commit e4eb6ff089
3 changed files with 19 additions and 3 deletions

View File

@@ -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