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)
diff --git a/src/vim9execute.c b/src/vim9execute.c
index 455a205..a13b0ab 100644
--- a/src/vim9execute.c
+++ b/src/vim9execute.c
@@ -4831,10 +4831,11 @@
{
typval_T tv;
char_u *name;
+ char_u buf[NUMBUFLEN];
tv.v_type = VAR_JOB;
tv.vval.v_job = iptr->isn_arg.job;
- name = tv_get_string(&tv);
+ name = job_to_string_buf(&tv, buf);
smsg("%s%4d PUSHJOB \"%s\"", pfx, current, name);
}
#endif