Patch 8.2.2094
Problem:    When an expression fails getting the next command may be wrong.
Solution:   Do not check for a next command after :eval fails. (closes #7415)
Files:      src/eval.c, src/testdir/test_vim9_cmd.vim


*** ../vim-8.2.2093/src/eval.c  2020-12-02 17:36:49.169409752 +0100
--- src/eval.c  2020-12-05 16:56:00.638055334 +0100
***************
*** 2156,2162 ****
                && called_emsg == called_emsg_before
                && (flags & EVAL_CONSTANT) == 0)
            semsg(_(e_invexpr2), arg);
!       ret = FAIL;
      }
  
      if (eap != NULL)
--- 2156,2165 ----
                && called_emsg == called_emsg_before
                && (flags & EVAL_CONSTANT) == 0)
            semsg(_(e_invexpr2), arg);
! 
!       // Some of the expression may not have been consumed.  Do not check for
!       // a next command to avoid more errors.
!       return FAIL;
      }
  
      if (eap != NULL)
*** ../vim-8.2.2093/src/testdir/test_vim9_cmd.vim       2020-12-02 
17:36:49.173409740 +0100
--- src/testdir/test_vim9_cmd.vim       2020-12-05 17:04:50.659393117 +0100
***************
*** 558,563 ****
--- 558,576 ----
          ->Increment()
    assert_equal(111 + 3 + 4 + 5, g:val)
    unlet g:val
+ 
+   var lines =<< trim END
+     vim9script
+     g:caught = 'no'
+     try
+       eval 123 || 0
+     catch
+       g:caught = 'yes'
+     endtry
+     assert_equal('yes', g:caught)
+     unlet g:caught
+   END
+   CheckScriptSuccess(lines)
  enddef
  
  def Test_map_command()
*** ../vim-8.2.2093/src/version.c       2020-12-05 14:44:33.512669314 +0100
--- src/version.c       2020-12-05 16:57:30.961672199 +0100
***************
*** 752,753 ****
--- 752,755 ----
  {   /* Add new patch number below this line */
+ /**/
+     2094,
  /**/

-- 
Compilation process failed successfully.

 /// 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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202012051612.0B5GCs0F851658%40masaka.moolenaar.net.

Raspunde prin e-mail lui