Patch 8.0.1423
Problem:    Error in return not caught by try/catch.
Solution:   Call update_force_abort(). (Yasuhiro Matsomoto, closes #2483)
Files:      src/testdir/test_eval.in, src/testdir/test_eval_stuff.vim,
            src/Makefile, src/testdir/Make_all.mak, src/userfunc.c


*** ../vim-8.0.1422/src/testdir/test_eval.in    2016-01-16 16:28:28.000000000 
+0100
--- src/testdir/test_eval.in    2017-12-22 21:45:54.912000069 +0100
***************
*** 1,5 ****
--- 1,7 ----
  Test for various eval features.   vim: set ft=vim :
  
+ NOTE: Do not add more here, use new style test test_eval_stuff.vim
+ 
  Note: system clipboard is saved, changed and restored.
  
  clipboard contents
***************
*** 134,143 ****
  let _clipreg = ['*', getreg('*'), getregtype('*')]
  let _clipopt = &cb
  let &cb='unnamed'
! 5y
  AR *
  tabdo :windo :echo "hi"
! 6y
  AR *
  let &cb=_clipopt
  call call('setreg', _clipreg)
--- 136,145 ----
  let _clipreg = ['*', getreg('*'), getregtype('*')]
  let _clipopt = &cb
  let &cb='unnamed'
! 7y
  AR *
  tabdo :windo :echo "hi"
! 8y
  AR *
  let &cb=_clipopt
  call call('setreg', _clipreg)
*** ../vim-8.0.1422/src/testdir/test_eval_stuff.vim     2017-12-22 
21:49:13.234952297 +0100
--- src/testdir/test_eval_stuff.vim     2017-12-22 21:39:48.097948458 +0100
***************
*** 0 ****
--- 1,13 ----
+ " Tests for various eval things.
+ 
+ function s:foo() abort
+   try
+     return [] == 0
+   catch
+     return 1
+   endtry
+ endfunction
+ 
+ func Test_catch_return_with_error()
+   call assert_equal(1, s:foo())
+ endfunc
*** ../vim-8.0.1422/src/Makefile        2017-12-11 22:55:08.556254393 +0100
--- src/Makefile        2017-12-22 21:40:11.221825069 +0100
***************
*** 2147,2152 ****
--- 2151,2157 ----
        test_edit \
        test_erasebackword \
        test_escaped_glob \
+       test_eval_stuff \
        test_ex_undo \
        test_ex_z \
        test_exec_while_if \
*** ../vim-8.0.1422/src/testdir/Make_all.mak    2017-12-11 22:55:08.556254393 
+0100
--- src/testdir/Make_all.mak    2017-12-22 21:40:40.853667086 +0100
***************
*** 94,99 ****
--- 94,100 ----
            test_edit.res \
            test_erasebackword.res \
            test_escaped_glob.res \
+           test_eval_stuff.res \
            test_exec_while_if.res \
            test_exists.res \
            test_exists_autocmd.res \
*** ../vim-8.0.1422/src/userfunc.c      2017-12-07 22:22:46.158236891 +0100
--- src/userfunc.c      2017-12-22 21:41:09.413514956 +0100
***************
*** 2972,2977 ****
--- 2972,2980 ----
      /* It's safer to return also on error. */
      else if (!eap->skip)
      {
+       /* In return statement, cause_abort should be force_abort. */
+       update_force_abort();
+ 
        /*
         * Return unless the expression evaluation has been cancelled due to an
         * aborting error, an interrupt, or an exception.
*** ../vim-8.0.1422/src/version.c       2017-12-22 21:12:28.419253561 +0100
--- src/version.c       2017-12-22 21:38:15.482443665 +0100
***************
*** 773,774 ****
--- 773,776 ----
  {   /* Add new patch number below this line */
+ /**/
+     1423,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
149. You find your computer sexier than your girlfriend

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui