Consider the following code:
% cat > test-filereadable.vim <<EOF
set nocompatible
let s:g={"load":{"saveoptions":{"abc":function("string")}}}
function TestFileReadable()
let file="/non-existent-file"
let tail="abc"
try
if filereadable(file)
call s:g.load.saveoptions[tail](readfile(file, 'b'))
endif
catch /^Vim(call):E15:/
endtry
endfunction
function TestFileReadable2()
for file in ["/non-existent-file"]
let tail="abc"
try
if filereadable(file)
call s:g.load.saveoptions[tail](readfile(file, 'b'))
endif
catch /^Vim(call):E15:/
endtry
endfor
endfunction
try
call TestFileReadable()
catch
call writefile([v:exception], "bad")
endtry
try
call TestFileReadable2()
catch
call writefile([v:exception], "bad2")
endtry
qa!
EOF
% vim -u NONE -S test-filereadable.vimIt has just the same code as script in previous bug, but with `try .. catch' and a `for' loop. Note that first exception is successfully caught, but second is not. Tested on vim-7.3.102 and on vim-7.3.107 from mercurial repository.
test-filereadable.vim
Description: application/wine-extension-vim
signature.asc
Description: This is a digitally signed message part.
