Patch 8.2.4358
Problem: Vim9: line number of exception is not set.
Solution: Set the line number before throwing an exception. (closes #9755)
Files: src/vim9execute.c, src/testdir/test_vim9_script.vim
*** ../vim-8.2.4357/src/vim9execute.c 2022-02-07 19:56:38.887286140 +0000
--- src/vim9execute.c 2022-02-12 13:59:57.553347325 +0000
***************
*** 3826,3831 ****
--- 3826,3832 ----
}
}
+ SOURCING_LNUM = iptr->isn_lnum;
if (throw_exception(tv->vval.v_string, ET_USER, NULL)
== FAIL)
{
*** ../vim-8.2.4357/src/testdir/test_vim9_script.vim 2022-02-06
20:28:08.791367997 +0000
--- src/testdir/test_vim9_script.vim 2022-02-12 13:59:13.605394700 +0000
***************
*** 1057,1062 ****
--- 1057,1074 ----
assert_match("NEWLIST size 0\n", instr)
enddef
+ def Test_throw_line_number()
+ def Func()
+ eval 1 + 1
+ eval 2 + 2
+ throw 'exception'
+ enddef
+ try
+ Func()
+ catch /exception/
+ assert_match('line 3', v:throwpoint)
+ endtry
+ enddef
def Test_throw_vimscript()
*** ../vim-8.2.4357/src/version.c 2022-02-12 13:30:12.764432008 +0000
--- src/version.c 2022-02-12 13:56:52.413612143 +0000
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 4358,
/**/
--
Due knot trussed yore spell chequer two fined awl miss steaks.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ 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/20220212142345.E82B31C0D2C%40moolenaar.net.