comparison src/testdir/test_vim9_script.vim @ 25260:a60895011da9 v8.2.3166

patch 8.2.3166: Vim9: nested autoload call error overruled by "Unknown error" Commit: https://github.com/vim/vim/commit/b5841b99e678da187b68c21f46d56a608a0dc10c Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jul 15 18:09:53 2021 +0200 patch 8.2.3166: Vim9: nested autoload call error overruled by "Unknown error" Problem: Vim9: nested autoload call error overruled by "Unknown error". Solution: Check need_rethrow before giving an "Unknown error". (closes #8568)
author Bram Moolenaar <Bram@vim.org>
date Thu, 15 Jul 2021 18:15:04 +0200
parents 658dfd6be868
children ca7a8ea2eb5f
comparison
equal deleted inserted replaced
25259:e1d3345ff21c 25260:a60895011da9
3697 au! CursorHold 3697 au! CursorHold
3698 END 3698 END
3699 CheckScriptSuccess(lines) 3699 CheckScriptSuccess(lines)
3700 enddef 3700 enddef
3701 3701
3702 def Test_error_in_autoload_script()
3703 var save_rtp = &rtp
3704 var dir = getcwd() .. '/Xruntime'
3705 &rtp = dir
3706 mkdir(dir .. '/autoload', 'p')
3707
3708 var lines =<< trim END
3709 vim9script noclear
3710 def script#autoloaded()
3711 enddef
3712 def Broken()
3713 var x: any = ''
3714 eval x != 0
3715 enddef
3716 Broken()
3717 END
3718 writefile(lines, dir .. '/autoload/script.vim')
3719
3720 lines =<< trim END
3721 vim9script
3722 def CallAutoloaded()
3723 script#autoloaded()
3724 enddef
3725
3726 function Legacy()
3727 try
3728 call s:CallAutoloaded()
3729 catch
3730 call assert_match('E1030: Using a String as a Number', v:exception)
3731 endtry
3732 endfunction
3733
3734 Legacy()
3735 END
3736 CheckScriptSuccess(lines)
3737
3738 &rtp = save_rtp
3739 delete(dir, 'rf')
3740 enddef
3741
3702 def Test_cmdline_win() 3742 def Test_cmdline_win()
3703 # if the Vim syntax highlighting uses Vim9 constructs they can be used from 3743 # if the Vim syntax highlighting uses Vim9 constructs they can be used from
3704 # the command line window. 3744 # the command line window.
3705 mkdir('rtp/syntax', 'p') 3745 mkdir('rtp/syntax', 'p')
3706 var export_lines =<< trim END 3746 var export_lines =<< trim END