patch 8.2.1916: Vim9: function call is aborted even when "silent!" is used

Problem:    Vim9: function call is aborted even when "silent!" is used.
Solution:   Use did_emsg instead of called_emsg. (closes #7213)
diff --git a/src/testdir/test_vim9_func.vim b/src/testdir/test_vim9_func.vim
index 9b10c2b..919af74 100644
--- a/src/testdir/test_vim9_func.vim
+++ b/src/testdir/test_vim9_func.vim
@@ -1462,6 +1462,35 @@
   call delete('XTest_silent_echo')
 endfunc
 
+def SilentlyError()
+  execute('silent! invalid')
+  g:did_it = 'yes'
+enddef
+
+"func UserError()
+"  silent! invalid
+"endfunc
+"
+"def SilentlyUserError()
+"  UserError()
+"  g:did_it = 'yes'
+"enddef
+
+" This can't be a :def function, because the assert would not be reached.
+" And this must not be inside a try/endtry.
+func Test_ignore_silent_error()
+  let g:did_it = 'no'
+  call SilentlyError()
+  call assert_equal('yes', g:did_it)
+
+"  this doesn't work yet
+"  let g:did_it = 'no'
+"  call SilentlyUserError()
+"  call assert_equal('yes', g:did_it)
+
+  unlet g:did_it
+endfunc
+
 def Fibonacci(n: number): number
   if n < 2
     return n
diff --git a/src/version.c b/src/version.c
index e2a588c..f1beb91 100644
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1916,
+/**/
     1915,
 /**/
     1914,
diff --git a/src/vim9execute.c b/src/vim9execute.c
index 341e5d0..c428a3d 100644
--- a/src/vim9execute.c
+++ b/src/vim9execute.c
@@ -550,7 +550,7 @@
 {
     typval_T	argvars[MAX_FUNC_ARGS];
     int		idx;
-    int		called_emsg_before = called_emsg;
+    int		did_emsg_before = did_emsg;
     ectx_T	*prev_ectx = current_ectx;
 
     if (call_prepare(argcount, argvars, ectx) == FAIL)
@@ -566,7 +566,7 @@
     for (idx = 0; idx < argcount; ++idx)
 	clear_tv(&argvars[idx]);
 
-    if (called_emsg != called_emsg_before)
+    if (did_emsg != did_emsg_before)
 	return FAIL;
     return OK;
 }
@@ -834,6 +834,7 @@
     msglist_T	*private_msg_list = NULL;
     cmdmod_T	save_cmdmod;
     int		restore_cmdmod = FALSE;
+    int		trylevel_at_start = trylevel;
 
 // Get pointer to item in the stack.
 #define STACK_TV(idx) (((typval_T *)ectx.ec_stack.ga_data) + idx)
@@ -2866,7 +2867,8 @@
 	continue;
 
 on_error:
-	if (trylevel == 0)
+	// If we are not inside a try-catch started here, abort execution.
+	if (trylevel <= trylevel_at_start)
 	    goto failed;
     }