<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rneovim.git/test/old/testdir/test_stacktrace.vim, branch rahm</title>
<subtitle>Neovim fork with Rahm's personal hacks.</subtitle>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/'/>
<entry>
<title>vim-patch:9.1.0999: Vim9: leaking finished exception (#31939)</title>
<updated>2025-01-10T00:03:44+00:00</updated>
<author>
<name>zeertzjq</name>
<email>zeertzjq@outlook.com</email>
</author>
<published>2025-01-10T00:03:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=846a2019c0e3b3a91477c12ec2c4ac85861b4d67'/>
<id>846a2019c0e3b3a91477c12ec2c4ac85861b4d67</id>
<content type='text'>
Problem:  leaking finished exception
          (after v9.1.0984)
Solution: use finish_exception to clean up caught exceptions
          (Yee Cheng Chin)

In Vimscript, v:exception/throwpoint/stacktrace are supposed to reflect
the currently caught exception, and be popped after the exception is
finished (via endtry, finally, or a thrown exception inside catch).
Vim9script does not handle this properly, and leaks them instead. This
is clearly visible when launching GVim with menu enabled.  A caught
exception inside the s:BMShow() in menu.vim would show up when querying
`v:stacktrace` even though the exception was already caught and handled.

To fix this, just use the same functionality as Vimscript by calling
`finish_exception` to properly restore the states. Note that this
assumes `current_exception` is always the same as `caught_stack` which
believe should be the case.

Added tests for this. Also fix up test_stacktrace to properly test the
stack restore behavior where we have nested exceptions in catch blocks
and to also test the vim9script functionality properly.

- Also, remove its dependency on explicitly checking a line number in
  runtest.vim which is a very fragile way to write tests as any minor
  change in runtest.vim (shared among all tests) would require changing
  test_stacktrace.vim. We don't actually need such granularity in the
  test.

closes: vim/vim#16413

https://github.com/vim/vim/commit/2051af1642843426714efc2572c3e270fe0948be

Co-authored-by: Yee Cheng Chin &lt;ychin.git@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem:  leaking finished exception
          (after v9.1.0984)
Solution: use finish_exception to clean up caught exceptions
          (Yee Cheng Chin)

In Vimscript, v:exception/throwpoint/stacktrace are supposed to reflect
the currently caught exception, and be popped after the exception is
finished (via endtry, finally, or a thrown exception inside catch).
Vim9script does not handle this properly, and leaks them instead. This
is clearly visible when launching GVim with menu enabled.  A caught
exception inside the s:BMShow() in menu.vim would show up when querying
`v:stacktrace` even though the exception was already caught and handled.

To fix this, just use the same functionality as Vimscript by calling
`finish_exception` to properly restore the states. Note that this
assumes `current_exception` is always the same as `caught_stack` which
believe should be the case.

Added tests for this. Also fix up test_stacktrace to properly test the
stack restore behavior where we have nested exceptions in catch blocks
and to also test the vim9script functionality properly.

- Also, remove its dependency on explicitly checking a line number in
  runtest.vim which is a very fragile way to write tests as any minor
  change in runtest.vim (shared among all tests) would require changing
  test_stacktrace.vim. We don't actually need such granularity in the
  test.

closes: vim/vim#16413

https://github.com/vim/vim/commit/2051af1642843426714efc2572c3e270fe0948be

Co-authored-by: Yee Cheng Chin &lt;ychin.git@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>vim-patch:9.1.0991: v:stacktrace has wrong type in Vim9 script</title>
<updated>2025-01-07T01:15:10+00:00</updated>
<author>
<name>zeertzjq</name>
<email>zeertzjq@outlook.com</email>
</author>
<published>2025-01-07T01:05:52+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=8fa4306eb910028ee8df8685ae9b1649608c2608'/>
<id>8fa4306eb910028ee8df8685ae9b1649608c2608</id>
<content type='text'>
Problem:  v:stacktrace has wrong type in Vim9 script.
Solution: Change the type to t_list_dict_any.  Fix grammar in docs.
          (zeertzjq)

closes: vim/vim#16390

https://github.com/vim/vim/commit/6655bef33047b826e0ccb8c686f3f57e47161b1c
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem:  v:stacktrace has wrong type in Vim9 script.
Solution: Change the type to t_list_dict_any.  Fix grammar in docs.
          (zeertzjq)

closes: vim/vim#16390

https://github.com/vim/vim/commit/6655bef33047b826e0ccb8c686f3f57e47161b1c
</pre>
</div>
</content>
</entry>
<entry>
<title>vim-patch:9.1.0984: exception handling can be improved</title>
<updated>2025-01-07T01:15:10+00:00</updated>
<author>
<name>zeertzjq</name>
<email>zeertzjq@outlook.com</email>
</author>
<published>2025-01-03T12:12:15+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=d5308637bf1aac2b97fccf73a0ffdef304eaa1d6'/>
<id>d5308637bf1aac2b97fccf73a0ffdef304eaa1d6</id>
<content type='text'>
Problem:  exception handling can be improved
Solution: add v:stacktrace and getstacktrace()

closes: vim/vim#16360

https://github.com/vim/vim/commit/663d18d6102f40d14e36096ec590445e61026ed6

Co-authored-by: ichizok &lt;gclient.gaap@gmail.com&gt;
Co-authored-by: Naruhiko Nishino &lt;naru123456789@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem:  exception handling can be improved
Solution: add v:stacktrace and getstacktrace()

closes: vim/vim#16360

https://github.com/vim/vim/commit/663d18d6102f40d14e36096ec590445e61026ed6

Co-authored-by: ichizok &lt;gclient.gaap@gmail.com&gt;
Co-authored-by: Naruhiko Nishino &lt;naru123456789@gmail.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
