Mercurial > vim
comparison src/testdir/test_vim9_script.vim @ 22612:b08f435d5b86 v8.2.1854
patch 8.2.1854: Vim9: crash when throwing exception for NULL string
Commit: https://github.com/vim/vim/commit/1e021e63c565bbb30783a557b4e883cc27f56403
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Oct 16 20:25:23 2020 +0200
patch 8.2.1854: Vim9: crash when throwing exception for NULL string
Problem: Vim9: crash when throwing exception for NULL string. (Dhiraj
Mishra)
Solution: Handle NULL string like empty string. (closes #7139)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 16 Oct 2020 20:30:04 +0200 |
parents | 2c77ec32deeb |
children | 576a69fc0066 |
comparison
equal
deleted
inserted
replaced
22611:377667e0a347 | 22612:b08f435d5b86 |
---|---|
613 throw 'one' | 613 throw 'one' |
614 .. 'two' | 614 .. 'two' |
615 catch | 615 catch |
616 assert_equal('onetwo', v:exception) | 616 assert_equal('onetwo', v:exception) |
617 endtry | 617 endtry |
618 END | |
619 CheckScriptSuccess(lines) | |
620 | |
621 lines =<< trim END | |
622 vim9script | |
623 def Func() | |
624 throw @r | |
625 enddef | |
626 var result = '' | |
627 try | |
628 Func() | |
629 catch /E1129:/ | |
630 result = 'caught' | |
631 endtry | |
632 assert_equal('caught', result) | |
618 END | 633 END |
619 CheckScriptSuccess(lines) | 634 CheckScriptSuccess(lines) |
620 enddef | 635 enddef |
621 | 636 |
622 def Test_error_in_nested_function() | 637 def Test_error_in_nested_function() |