0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.2.2944: Vim9: no error when using job or channel as a string

Problem:    Vim9: no error when using job or channel as a string.
Solution:   Be more strict about conversion to string. (closes #8312)
This commit is contained in:
Bram Moolenaar
2021-06-05 20:51:38 +02:00
parent c6d71532dd
commit 1328bde9d4
9 changed files with 76 additions and 34 deletions

View File

@@ -5060,7 +5060,8 @@ echo_string_core(
case VAR_JOB:
case VAR_CHANNEL:
*tofree = NULL;
r = tv_get_string_buf(tv, numbuf);
r = tv->v_type == VAR_JOB ? job_to_string_buf(tv, numbuf)
: channel_to_string_buf(tv, numbuf);
if (composite_val)
{
*tofree = string_quote(r, FALSE);