comparison src/testdir/test_debugger.vim @ 27457:4c16acb2525f v8.2.4257

patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent Commit: https://github.com/vim/vim/commit/62aec93bfdb9e1b40d03a6d2e8e9511f8b1bdb2d Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jan 29 21:45:34 2022 +0000 patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent Problem: Vim9: finding global function without g: prefix but not finding global variable is inconsistent. Solution: Require using g: for a global function. Change the vim9.vim script into a Vim9 script with exports. Fix that import in legacy script does not work.
author Bram Moolenaar <Bram@vim.org>
date Sat, 29 Jan 2022 23:00:05 +0100
parents f15bf2470359
children 73f4d1e479f2
comparison
equal deleted inserted replaced
27456:a8e2d91995ce 27457:4c16acb2525f
358 breakdel * 358 breakdel *
359 END 359 END
360 writefile(lines, 'Xtest.vim') 360 writefile(lines, 'Xtest.vim')
361 361
362 # Start Vim in a terminal 362 # Start Vim in a terminal
363 var buf = RunVimInTerminal('-S Xtest.vim', {wait_for_ruler: 0}) 363 var buf = g:RunVimInTerminal('-S Xtest.vim', {wait_for_ruler: 0})
364 call TermWait(buf) 364 call g:TermWait(buf)
365 365
366 # Despite the failure the functions are defined 366 # Despite the failure the functions are defined
367 RunDbgCmd(buf, ':function g:EarlyFunc', 367 g:RunDbgCmd(buf, ':function g:EarlyFunc',
368 ['function EarlyFunc()', 'endfunction'], {match: 'pattern'}) 368 ['function EarlyFunc()', 'endfunction'], {match: 'pattern'})
369 RunDbgCmd(buf, ':function g:LaterFunc', 369 g:RunDbgCmd(buf, ':function g:LaterFunc',
370 ['function LaterFunc()', 'endfunction'], {match: 'pattern'}) 370 ['function LaterFunc()', 'endfunction'], {match: 'pattern'})
371 371
372 call StopVimInTerminal(buf) 372 call g:StopVimInTerminal(buf)
373 call delete('Xtest.vim') 373 call delete('Xtest.vim')
374 enddef 374 enddef
375 375
376 def Test_Debugger_break_at_return() 376 def Test_Debugger_break_at_return()
377 var lines =<< trim END 377 var lines =<< trim END
384 breakadd func GetNum 384 breakadd func GetNum
385 END 385 END
386 writefile(lines, 'Xtest.vim') 386 writefile(lines, 'Xtest.vim')
387 387
388 # Start Vim in a terminal 388 # Start Vim in a terminal
389 var buf = RunVimInTerminal('-S Xtest.vim', {wait_for_ruler: 0}) 389 var buf = g:RunVimInTerminal('-S Xtest.vim', {wait_for_ruler: 0})
390 call TermWait(buf) 390 call g:TermWait(buf)
391 391
392 RunDbgCmd(buf, ':call GetNum()', 392 g:RunDbgCmd(buf, ':call GetNum()',
393 ['line 1: return 1 + 2 + 3'], {match: 'pattern'}) 393 ['line 1: return 1 + 2 + 3'], {match: 'pattern'})
394 394
395 call StopVimInTerminal(buf) 395 call g:StopVimInTerminal(buf)
396 call delete('Xtest.vim') 396 call delete('Xtest.vim')
397 enddef 397 enddef
398 398
399 func Test_Backtrace_Through_Source() 399 func Test_Backtrace_Through_Source()
400 CheckCWD 400 CheckCWD