Mercurial > vim
comparison src/testdir/test_lua.vim @ 29196:e391590249a1 v8.2.5117
patch 8.2.5117: crash when calling a Lua callback from a :def function
Commit: https://github.com/vim/vim/commit/7d149f899d423b7bf2b90d7b11ebe3e560c462b9
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Jun 17 19:23:34 2022 +0100
patch 8.2.5117: crash when calling a Lua callback from a :def function
Problem: Crash when calling a Lua callback from a :def function. (Bohdan
Makohin)
Solution: Handle FC_CFUNC in call_user_func_check(). (closes #10587)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 17 Jun 2022 20:30:03 +0200 |
parents | b4c111ea83b1 |
children | 029c59bf78f1 |
comparison
equal
deleted
inserted
replaced
29195:ee8ebed77cee | 29196:e391590249a1 |
---|---|
660 | 660 |
661 " Error cases | 661 " Error cases |
662 lua t = {} | 662 lua t = {} |
663 call assert_fails('lua b = vim.blob(t)', | 663 call assert_fails('lua b = vim.blob(t)', |
664 \ '[string "vim chunk"]:1: string expected, got table') | 664 \ '[string "vim chunk"]:1: string expected, got table') |
665 endfunc | |
666 | |
667 def Vim9Test(Callback: func()) | |
668 Callback() | |
669 enddef | |
670 | |
671 func Test_call_lua_func_from_vim9_func() | |
672 " this only tests that Vim doesn't crash | |
673 lua << EOF | |
674 vim.fn.Vim9Test(function () print('Hello') end) | |
675 EOF | |
665 endfunc | 676 endfunc |
666 | 677 |
667 func Test_lua_funcref() | 678 func Test_lua_funcref() |
668 function I(x) | 679 function I(x) |
669 return a:x | 680 return a:x |