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

patch 8.2.2597: Vim9: "import * as" does not work at script level

Problem:    Vim9: "import * as" does not work at script level.
Solution:   Implement using an imported namespace.
This commit is contained in:
Bram Moolenaar
2021-03-13 20:57:19 +01:00
parent 41cd80335c
commit cb4e80fab9
10 changed files with 129 additions and 23 deletions

View File

@@ -257,7 +257,8 @@ find_exported(
char_u *name,
ufunc_T **ufunc,
type_T **type,
cctx_T *cctx)
cctx_T *cctx,
int verbose)
{
int idx = -1;
svar_T *sv;
@@ -271,7 +272,8 @@ find_exported(
sv = ((svar_T *)script->sn_var_vals.ga_data) + idx;
if (!sv->sv_export)
{
semsg(_(e_item_not_exported_in_script_str), name);
if (verbose)
semsg(_(e_item_not_exported_in_script_str), name);
return -1;
}
*type = sv->sv_type;
@@ -301,7 +303,8 @@ find_exported(
if (*ufunc == NULL)
{
semsg(_(e_item_not_found_in_script_str), name);
if (verbose)
semsg(_(e_item_not_found_in_script_str), name);
return -1;
}
}
@@ -532,7 +535,7 @@ handle_import(
ufunc_T *ufunc = NULL;
type_T *type;
idx = find_exported(sid, name, &ufunc, &type, cctx);
idx = find_exported(sid, name, &ufunc, &type, cctx, TRUE);
if (idx < 0 && ufunc == NULL)
goto erret;