0
0
mirror of https://github.com/vim/vim.git synced 2025-10-07 05:54:16 -04:00

patch 8.2.4526: Vim9: cannot set variables to a null value

Problem:    Vim9: cannot set variables to a null value.
Solution:   Add null_list, null_job, etc.
This commit is contained in:
Bram Moolenaar
2022-03-08 13:18:55 +00:00
parent 08238045e7
commit 8acb9cc620
16 changed files with 346 additions and 51 deletions

View File

@@ -157,12 +157,28 @@ endfunc
func Test_loop_over_null_list()
let lines =<< trim END
VAR null_list = test_null_list()
for i in null_list
VAR nulllist = test_null_list()
for i in nulllist
call assert_report('should not get here')
endfor
END
call v9.CheckLegacyAndVim9Success(lines)
let lines =<< trim END
var nulllist = null_list
for i in nulllist
call assert_report('should not get here')
endfor
END
call v9.CheckDefAndScriptSuccess(lines)
let lines =<< trim END
let nulllist = null_list
for i in nulllist
call assert_report('should not get here')
endfor
END
call v9.CheckScriptFailure(lines, 'E121: Undefined variable: null_list')
endfunc
func Test_setreg_null_list()