diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-03-19 21:59:19 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-03-19 21:59:19 +0100 |
commit | 4eefe47ea4b6bf958617e924f52bc7a409cfb0ed (patch) | |
tree | 15470a0a1c9387e5b7e30ecce841cd75fa63d42d /src/testdir/test_lua.vim | |
parent | 8376c3d3216f65b93fb3bc03dbbe0c1bdf4faeff (diff) | |
download | vim-git-4eefe47ea4b6bf958617e924f52bc7a409cfb0ed.tar.gz |
patch 8.1.1019: Lua: may garbage collect function reference in usev8.1.1019
Problem: Lua: may garbage collect function reference in use.
Solution: Keep the function name instead of the typeval. Make luaV_setref()
handle funcref objects. (Ozaki Kiichi, closes #4127)
Diffstat (limited to 'src/testdir/test_lua.vim')
-rw-r--r-- | src/testdir/test_lua.vim | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/testdir/test_lua.vim b/src/testdir/test_lua.vim index 7fcdad5f0..ec28183b1 100644 --- a/src/testdir/test_lua.vim +++ b/src/testdir/test_lua.vim @@ -449,6 +449,7 @@ func Test_funcref() lua d.len = vim.funcref"Mylen" -- assign d as 'self' lua res = (d.len() == vim.funcref"len"(vim.eval"l")) and "OK" or "FAIL" call assert_equal("OK", luaeval('res')) + call assert_equal(function('Mylen', {'data': l, 'len': function('Mylen')}), mydict.len) lua i1, i2, msg, d, res = nil endfunc |