g:imported_added = exported
g:imported_func = Exported()
+ def GetExported(): string
+ let local_dict = #{ref: Exported}
+ return local_dict.ref()
+ enddef
+ g:funcref_result = GetExported()
+
import {exp_name} from './Xexport.vim'
g:imported_name = exp_name
exp_name ..= ' Doe'
assert_equal(9879, g:imported_added)
assert_equal(9879, g:imported_later)
assert_equal('Exported', g:imported_func)
+ assert_equal('Exported', g:funcref_result)
assert_equal('John', g:imported_name)
assert_equal('John Doe', g:imported_name_appended)
assert_false(exists('g:name'))
if (ga_grow(stack, 1) == FAIL)
return NULL;
- ((type_T **)stack->ga_data)[stack->ga_len] = type;
+ ((type_T **)stack->ga_data)[stack->ga_len] = type == NULL ? &t_any : type;
++stack->ga_len;
return isn;
RETURN_OK_IF_SKIP(cctx);
if ((isn = generate_instr_type(cctx, ISN_PUSHFUNC, type)) == NULL)
return FAIL;
- isn->isn_arg.string = name;
+ isn->isn_arg.string = name == NULL ? NULL : vim_strsave(name);
return OK;
}
idx,
type);
}
+ else if (import->imp_funcname != NULL)
+ generate_PUSHFUNC(cctx, import->imp_funcname, import->imp_type);
else
- {
- // TODO: check this is a variable, not a function?
generate_VIM9SCRIPT(cctx, ISN_LOADSCRIPT,
import->imp_sid,
import->imp_var_vals_idx,
import->imp_type);
- }
return OK;
}
if (ufunc->uf_def_status == UF_TO_BE_COMPILED)
if (compile_def_function(ufunc, TRUE, NULL) == FAIL)
return FAIL;
- return generate_PUSHFUNC(cctx, vim_strsave(ufunc->uf_name),
- ufunc->uf_func_type);
+ return generate_PUSHFUNC(cctx, ufunc->uf_name, ufunc->uf_func_type);
}
/*