comparison src/userfunc.c @ 26556:dff04b7fa6b2 v8.2.3807

patch 8.2.3807: Vim9: can call import with star directly Commit: https://github.com/vim/vim/commit/f8a79fc3468645019532331bf8b36d1f7b403ef4 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Dec 14 12:06:16 2021 +0000 patch 8.2.3807: Vim9: can call import with star directly Problem: Vim9: can call import with star directly. Solution: Check that the import used star.
author Bram Moolenaar <Bram@vim.org>
date Tue, 14 Dec 2021 13:15:03 +0100
parents 682ff45f289f
children ba52a5ef59f1
comparison
equal deleted inserted replaced
26555:2ea8b67ac427 26556:dff04b7fa6b2
1594 { 1594 {
1595 s = import->imp_funcname; 1595 s = import->imp_funcname;
1596 *lenp = (int)STRLEN(s); 1596 *lenp = (int)STRLEN(s);
1597 return s; 1597 return s;
1598 } 1598 }
1599 // TODO: what if (import->imp_flags & IMP_FLAGS_STAR) 1599 if (import->imp_flags & IMP_FLAGS_STAR)
1600 {
1601 name[len] = NUL;
1602 semsg(_(e_cannot_use_str_itself_it_is_imported_with_star),
1603 name);
1604 name[len] = cc;
1605 *lenp = 0;
1606 return (char_u *)""; // just in case
1607 }
1608 else
1600 { 1609 {
1601 scriptitem_T *si = SCRIPT_ITEM(import->imp_sid); 1610 scriptitem_T *si = SCRIPT_ITEM(import->imp_sid);
1602 svar_T *sv = ((svar_T *)si->sn_var_vals.ga_data) 1611 svar_T *sv = ((svar_T *)si->sn_var_vals.ga_data)
1603 + import->imp_var_vals_idx; 1612 + import->imp_var_vals_idx;
1604 tv = sv->sv_tv; 1613 tv = sv->sv_tv;