1
0
forked from aniani/vim

patch 7.4.1839

Problem:    Cannot get the items stored in a partial.
Solution:   Support using get() on a partial.
This commit is contained in:
Bram Moolenaar
2016-05-24 18:37:12 +02:00
parent 574860b5ee
commit 2bbf8eff6f
4 changed files with 56 additions and 0 deletions

View File

@@ -279,3 +279,12 @@ func Test_auto_partial_rebind()
call assert_equal('dict1', dict2.f2())
call assert_equal('dict1', dict2['f2']())
endfunc
func Test_get_partial_items()
let dict = {'name': 'hello'}
let Cb = function('MyDictFunc', ["foo", "bar"], dict)
call assert_equal('MyDictFunc', get(Cb, 'func'))
call assert_equal(["foo", "bar"], get(Cb, 'args'))
call assert_equal(dict, get(Cb, 'dict'))
call assert_fails('call get(Cb, "xxx")', 'E475:')
endfunc