Skip to content

Conversation

mattn
Copy link
Member

@mattn mattn commented Dec 22, 2017

function! s:foo()
  try
    return [] == 0
  catch
    return 1
  endtry
endfunction

echo s:foo()

This must be 1. But E691 occured.

@codecov-io
Copy link

Codecov Report

Merging #2483 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2483      +/-   ##
==========================================
- Coverage   74.58%   74.58%   -0.01%     
==========================================
  Files          92       92              
  Lines      132982   132984       +2     
==========================================
- Hits        99183    99180       -3     
- Misses      33799    33804       +5
Impacted Files Coverage Δ
src/userfunc.c 86.74% <100%> (ø) ⬆️
src/if_xcmdsrv.c 83.63% <0%> (-0.72%) ⬇️
src/eval.c 80.96% <0%> (-0.05%) ⬇️
src/os_unix.c 54.33% <0%> (-0.05%) ⬇️
src/gui_gtk_x11.c 47.65% <0%> (ø) ⬆️
src/gui.c 47.47% <0%> (ø) ⬆️
src/if_py_both.h 76.59% <0%> (ø) ⬆️
src/channel.c 82.76% <0%> (+0.08%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3c09722...46ad23f. Read the comment docs.

rhysd added a commit to rhysd/vital.vim that referenced this pull request Dec 22, 2017
@brammool brammool closed this in fabaf75 Dec 23, 2017
adizero pushed a commit to adizero/vim that referenced this pull request May 19, 2018
Problem:    Error in return not caught by try/catch.
Solution:   Call update_force_abort(). (Yasuhiro Matsomoto, closes vim#2483)
janlazo added a commit to janlazo/neovim that referenced this pull request Sep 4, 2018
Problem:    Error in return not caught by try/catch.
Solution:   Call update_force_abort(). (Yasuhiro Matsomoto, closes vim/vim#2483)
vim/vim@fabaf75
janlazo added a commit to janlazo/neovim that referenced this pull request Sep 18, 2018
Problem:    Error in return not caught by try/catch.
Solution:   Call update_force_abort(). (Yasuhiro Matsomoto, closes vim/vim#2483)
vim/vim@fabaf75
janlazo added a commit to janlazo/neovim that referenced this pull request Oct 1, 2018
Problem:    Error in return not caught by try/catch.
Solution:   Call update_force_abort(). (Yasuhiro Matsomoto, closes vim/vim#2483)
vim/vim@fabaf75
janlazo added a commit to janlazo/neovim that referenced this pull request Oct 10, 2018
Problem:    Error in return not caught by try/catch.
Solution:   Call update_force_abort(). (Yasuhiro Matsomoto, closes vim/vim#2483)
vim/vim@fabaf75
janlazo added a commit to janlazo/neovim that referenced this pull request Oct 10, 2018
Problem:    Error in return not caught by try/catch.
Solution:   Call update_force_abort(). (Yasuhiro Matsomoto, closes vim/vim#2483)
vim/vim@fabaf75
dmitrivereshchagin added a commit to dmitrivereshchagin/vim-test that referenced this pull request Jan 25, 2021
Test Runners that provide build_args() taking one argument cannot
be used in Vim before 8.0.1423 (and Neovim, vim-test#505).

This change adds workaround for Vim (and Neovim) versions that fail
to caught an exception thrown from return statement:

<vim/vim#2483>
dmitrivereshchagin added a commit to dmitrivereshchagin/vim-test that referenced this pull request Jan 25, 2021
Test runners that provide build_args() taking one argument cannot
be used in Vim before 8.0.1423 (and Neovim, vim-test#505).

This change adds workaround for Vim (and Neovim) versions that fail
to caught an exception thrown from return statement:

<vim/vim#2483>
codeinabox pushed a commit to vim-test/vim-test that referenced this pull request Jan 28, 2021
* Avoid uncaught exception in test#base#build_args()

Test runners that provide build_args() taking one argument cannot
be used in Vim before 8.0.1423 (and Neovim, #505).

This change adds workaround for Vim (and Neovim) versions that fail
to caught an exception thrown from return statement:

<vim/vim#2483>

* Add abort to function definition

It's used by all function definitions and doesn't conflict with
exception handling using try/catch.

* Make catch pattern more precise

Colon always follows error number.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants