1
0
forked from aniani/vim

patch 8.1.1921: more functions can be used as methods

Problem:    More functions can be used as methods.
Solution:   Make various functions usable as a method.
This commit is contained in:
Bram Moolenaar
2019-08-24 20:50:19 +02:00
parent f63962378d
commit a4208966fb
13 changed files with 109 additions and 44 deletions

View File

@@ -403,7 +403,7 @@ function Test_printf_spec_s()
call assert_equal(string(value), printf('%s', value))
" funcref
call assert_equal('printf', printf('%s', function('printf')))
call assert_equal('printf', printf('%s', 'printf'->function()))
" partial
call assert_equal(string(function('printf', ['%s'])), printf('%s', function('printf', ['%s'])))
@@ -490,7 +490,7 @@ func Test_funcref()
endfunc
call assert_equal(2, OneByName())
call assert_equal(1, OneByRef())
let OneByRef = funcref('One')
let OneByRef = 'One'->funcref()
call assert_equal(2, OneByRef())
call assert_fails('echo funcref("{")', 'E475:')
endfunc