Patch 8.2.0331
Problem: Internal error when using test_void() and test_unknown().
(Dominique Pelle)
Solution: Give a normal error.
Files: src/evalfunc.c, src/testdir/test_functions.vim,
src/testdir/test_vimscript.vim
*** ../vim-8.2.0330/src/evalfunc.c 2020-02-26 16:15:31.068386966 +0100
--- src/evalfunc.c 2020-02-29 13:39:39.759674319 +0100
***************
*** 1890,1896 ****
#endif
case VAR_UNKNOWN:
case VAR_VOID:
! internal_error("f_empty(UNKNOWN)");
n = TRUE;
break;
}
--- 1890,1899 ----
#endif
case VAR_UNKNOWN:
case VAR_VOID:
! // Let's not use internal_error() here, otherwise
! // empty(test_unknown()) with ABORT_ON_INTERNAL_ERROR defined makes
! // Vim abort.
! semsg(_(e_intern2), "f_empty(UNKNOWN)");
n = TRUE;
break;
}
***************
*** 8275,8281 ****
case VAR_BLOB: n = VAR_TYPE_BLOB; break;
case VAR_UNKNOWN:
case VAR_VOID:
! internal_error("f_type(UNKNOWN)");
n = -1;
break;
}
--- 8278,8287 ----
case VAR_BLOB: n = VAR_TYPE_BLOB; break;
case VAR_UNKNOWN:
case VAR_VOID:
! // Let's not use internal_error() here, otherwise
! // empty(test_unknown()) with ABORT_ON_INTERNAL_ERROR defined
! // makes Vim abort.
! semsg(_(e_intern2), "f_type(UNKNOWN)");
n = -1;
break;
}
*** ../vim-8.2.0330/src/testdir/test_functions.vim 2020-02-27
21:32:38.681185130 +0100
--- src/testdir/test_functions.vim 2020-02-29 13:33:55.513048646 +0100
***************
*** 58,63 ****
--- 58,66 ----
call assert_equal(0, empty(function('Test_empty')))
call assert_equal(0, empty(function('Test_empty', [0])))
+
+ call assert_fails("call empty(test_void())", 'E685:')
+ call assert_fails("call empty(test_unknown())", 'E685:')
endfunc
func Test_len()
*** ../vim-8.2.0330/src/testdir/test_vimscript.vim 2020-02-21
17:54:41.834235694 +0100
--- src/testdir/test_vimscript.vim 2020-02-29 13:39:51.239628485 +0100
***************
*** 1165,1170 ****
--- 1165,1172 ----
call assert_equal(v:t_none, type(v:none))
call assert_equal(v:t_none, type(v:null))
+ call assert_fails("call type(test_void())", 'E685:')
+ call assert_fails("call type(test_unknown())", 'E685:')
call assert_equal(0, 0 + v:false)
call assert_equal(1, 0 + v:true)
*** ../vim-8.2.0330/src/version.c 2020-02-28 22:51:51.107937519 +0100
--- src/version.c 2020-02-29 13:34:59.420793531 +0100
***************
*** 740,741 ****
--- 740,743 ----
{ /* Add new patch number below this line */
+ /**/
+ 331,
/**/
--
In a world without fences, who needs Gates and Windows?
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/202002291243.01TChwgG010801%40masaka.moolenaar.net.