Mercurial > vim
comparison src/testdir/test_vim9_func.vim @ 26530:2fbd05a873e3 v8.2.3794
patch 8.2.3794: Vim9: cannot find script-local func using "s:"
Commit: https://github.com/vim/vim/commit/33b968dc60c5fa39451098e680c7559ebc65d1a7
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Dec 13 11:31:04 2021 +0000
patch 8.2.3794: Vim9: cannot find script-local func using "s:"
Problem: Vim9: cannot find script-local func using "s:". (Yegappan
Lakshmanan)
Solution: Skip the "s:".
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 13 Dec 2021 12:45:03 +0100 |
parents | 4d8226001391 |
children | dfa658800f21 |
comparison
equal
deleted
inserted
replaced
26529:1de68d78a929 | 26530:2fbd05a873e3 |
---|---|
1239 assert_equal(4, g:result) | 1239 assert_equal(4, g:result) |
1240 bwipe! | 1240 bwipe! |
1241 END | 1241 END |
1242 CheckScriptSuccess(lines) | 1242 CheckScriptSuccess(lines) |
1243 &operatorfunc = '' | 1243 &operatorfunc = '' |
1244 enddef | |
1245 | |
1246 def Test_use_script_func_name_with_prefix() | |
1247 var lines =<< trim END | |
1248 vim9script | |
1249 func s:Getit() | |
1250 return 'it' | |
1251 endfunc | |
1252 var Fn = s:Getit | |
1253 assert_equal('it', Fn()) | |
1254 END | |
1255 CheckScriptSuccess(lines) | |
1244 enddef | 1256 enddef |
1245 | 1257 |
1246 def Test_lambda_type_allocated() | 1258 def Test_lambda_type_allocated() |
1247 # Check that unreferencing a partial using a lambda can use the variable type | 1259 # Check that unreferencing a partial using a lambda can use the variable type |
1248 # after the lambda has been freed and does not leak memory. | 1260 # after the lambda has been freed and does not leak memory. |