call writefile(lines, 'Xdef')
try
source Xdef
+ assert_report('should have failed')
catch /E476:/
assert_match('Invalid command: invalid', v:exception)
assert_match(', line 3$', v:throwpoint)
call writefile(lines, 'Xdef')
try
source Xdef
+ assert_report('should have failed')
catch /E476:/
assert_match('Invalid command: invalid', v:exception)
assert_match(', line 4$', v:throwpoint)
endtry
+ lines =<< trim END
+ vim9script
+ def Func()
+ let db = #{foo: 1, bar: 2}
+ # comment
+ let x = db.asdf
+ enddef
+ defcompile
+ Func()
+ END
+ call writefile(lines, 'Xdef')
+ try
+ source Xdef
+ assert_report('should have failed')
+ catch /E716:/
+ assert_match('_Func, line 3$', v:throwpoint)
+ endtry
+
call delete('Xdef')
enddef
tv = STACK_TV_BOT(idx - count);
if (tv->v_type == VAR_CHANNEL || tv->v_type == VAR_JOB)
{
+ SOURCING_LNUM = iptr->isn_lnum;
emsg(_(e_inval_string));
break;
}
if (di == NULL)
{
+ SOURCING_LNUM = iptr->isn_lnum;
semsg(_(e_undefvar), name);
goto on_error;
}
if (di == NULL)
{
+ SOURCING_LNUM = iptr->isn_lnum;
semsg(_("E121: Undefined variable: %c:%s"),
namespace, iptr->isn_arg.string);
goto on_error;
clear_tv(tv);
if (msg != NULL)
{
+ SOURCING_LNUM = iptr->isn_lnum;
emsg(_(msg));
goto on_error;
}
lidx = list->lv_len + lidx;
if (lidx < 0 || lidx > list->lv_len)
{
+ SOURCING_LNUM = iptr->isn_lnum;
semsg(_(e_listidx), lidx);
goto on_error;
}
if (dict == NULL)
{
+ SOURCING_LNUM = iptr->isn_lnum;
emsg(_(e_dictionary_not_set));
goto on_error;
}
item = dict_find(dict, tv->vval.v_string, -1);
if (item != NULL)
{
+ SOURCING_LNUM = iptr->isn_lnum;
semsg(_(e_duplicate_key), tv->vval.v_string);
dict_unref(dict);
goto on_error;
if (tv->v_type == VAR_PARTIAL)
{
// TODO: use a garray_T on ectx.
+ SOURCING_LNUM = iptr->isn_lnum;
emsg("Multiple closures not supported yet");
goto failed;
}
case ISN_PUSHEXC:
if (current_exception == NULL)
{
+ SOURCING_LNUM = iptr->isn_lnum;
iemsg("Evaluating catch while current_exception is NULL");
goto failed;
}
case EXPR_DIV: f1 = f1 / f2; break;
case EXPR_SUB: f1 = f1 - f2; break;
case EXPR_ADD: f1 = f1 + f2; break;
- default: emsg(_(e_modulus));
+ default: SOURCING_LNUM = iptr->isn_lnum;
+ emsg(_(e_modulus));
goto on_error;
}
clear_tv(tv1);
tv = STACK_TV_BOT(-2);
if (tv->v_type != VAR_STRING)
{
+ SOURCING_LNUM = iptr->isn_lnum;
emsg(_(e_stringreq));
goto on_error;
}
tv = STACK_TV_BOT(-1);
if (tv->v_type != VAR_NUMBER)
{
+ SOURCING_LNUM = iptr->isn_lnum;
emsg(_(e_number_exp));
goto on_error;
}
tv = STACK_TV_BOT(-2);
if (tv->v_type != VAR_LIST)
{
+ SOURCING_LNUM = iptr->isn_lnum;
emsg(_(e_listreq));
goto on_error;
}
tv = STACK_TV_BOT(-1);
if (tv->v_type != VAR_NUMBER)
{
+ SOURCING_LNUM = iptr->isn_lnum;
emsg(_(e_number_exp));
goto on_error;
}
clear_tv(tv);
if ((li = list_find(list, n)) == NULL)
{
+ SOURCING_LNUM = iptr->isn_lnum;
semsg(_(e_listidx), n);
goto on_error;
}
if ((di = dict_find(dict, key, -1)) == NULL)
{
+ SOURCING_LNUM = iptr->isn_lnum;
semsg(_(e_dictkey), key);
goto on_error;
}
tv = STACK_TV_BOT(-1);
if (tv->v_type != VAR_DICT || tv->vval.v_dict == NULL)
{
+ SOURCING_LNUM = iptr->isn_lnum;
emsg(_(e_dictreq));
goto on_error;
}
if ((di = dict_find(dict, iptr->isn_arg.string, -1))
== NULL)
{
+ SOURCING_LNUM = iptr->isn_lnum;
semsg(_(e_dictkey), iptr->isn_arg.string);
goto on_error;
}
#endif
)
{
+ SOURCING_LNUM = iptr->isn_lnum;
emsg(_(e_number_exp));
goto on_error;
}
|| (tv->v_type == VAR_FUNC
&& ct->ct_type == VAR_PARTIAL)))
{
+ SOURCING_LNUM = iptr->isn_lnum;
semsg(_("E1029: Expected %s but got %s"),
vartype_name(ct->ct_type),
vartype_name(tv->v_type));
|| (list->lv_len > min_len
&& !iptr->isn_arg.checklen.cl_more_OK))
{
+ SOURCING_LNUM = iptr->isn_lnum;
semsg(_("E1093: Expected %d items but got %d"),
min_len, list == NULL ? 0 : list->lv_len);
goto on_error;