To: vim_dev@googlegroups.com Subject: Patch 8.2.0700 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.0700 Problem: Vim9: converting error message to exception not tested. Solution: Test exception from error. Do not continue after :echoerr. Files: src/vim9execute.c, src/testdir/test_vim9_script.vim *** ../vim-8.2.0699/src/vim9execute.c 2020-05-05 21:25:19.141316752 +0200 --- src/vim9execute.c 2020-05-05 22:05:51.226718195 +0200 *************** *** 898,911 **** } else { - int save_did_emsg = did_emsg; - SOURCING_LNUM = iptr->isn_lnum; emsg(ga.ga_data); - if (!force_abort) - // We don't want to abort following - // commands, restore did_emsg. - did_emsg = save_did_emsg; } } } --- 898,905 ---- *** ../vim-8.2.0699/src/testdir/test_vim9_script.vim 2020-04-28 21:29:30.625687348 +0200 --- src/testdir/test_vim9_script.vim 2020-05-05 22:00:55.859764858 +0200 *************** *** 466,471 **** --- 466,485 ---- call CheckDefFailure(['throw xxx'], 'E1001:') enddef + let someJob = test_null_job() + + def FuncWithError() + echomsg g:someJob + enddef + + func Test_convert_emsg_to_exception() + try + call FuncWithError() + catch + call assert_match('Vim:E908:', v:exception) + endtry + endfunc + let s:export_script_lines =<< trim END vim9script let name: string = 'bob' *************** *** 1058,1064 **** enddef def Test_echoerr_cmd() ! # TODO: write this test enddef def Test_for_outside_of_function() --- 1072,1082 ---- enddef def Test_echoerr_cmd() ! try ! echoerr 'something' 'wrong' # comment ! catch ! assert_match('something wrong', v:exception) ! endtry enddef def Test_for_outside_of_function() *** ../vim-8.2.0699/src/version.c 2020-05-05 21:25:19.145316739 +0200 --- src/version.c 2020-05-05 22:07:29.706361789 +0200 *************** *** 748,749 **** --- 748,751 ---- { /* Add new patch number below this line */ + /**/ + 700, /**/ -- hundred-and-one symptoms of being an internet addict: 51. You put a pillow case over your laptop so your lover doesn't see it while you are pretending to catch your breath. /// Bram Moolenaar -- Bram@Moolenaar.net -- 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 ///