patch 9.1.1146: Vim9: wrong context being used when evaluating class member
Problem: Vim9: wrong context being used when evaluating class member
(lifepillar, Ernie Rael)
Solution: Use the correct script context when evaluating a class member
init expression(Yegappan Lakshmanan)
fixes: #14011
fixes: #14402
closes: #15112
closes: #16660
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/proto/vim9compile.pro b/src/proto/vim9compile.pro
index c918aea..080a2ff 100644
--- a/src/proto/vim9compile.pro
+++ b/src/proto/vim9compile.pro
@@ -12,7 +12,6 @@
lvar_T *reserve_local(cctx_T *cctx, char_u *name, size_t len, int assign, type_T *type);
int get_script_item_idx(int sid, char_u *name, int check_writable, cctx_T *cctx, cstack_T *cstack);
imported_T *find_imported(char_u *name, size_t len, int load);
-imported_T *find_imported_from_extends(cctx_T *cctx, char_u *name, size_t len, int load);
char_u *may_peek_next_line(cctx_T *cctx, char_u *arg, char_u **nextp);
char_u *peek_next_line_from_context(cctx_T *cctx);
char_u *next_line_from_context(cctx_T *cctx, int skip_comment);
diff --git a/src/proto/vim9expr.pro b/src/proto/vim9expr.pro
index d28908c..f58e346 100644
--- a/src/proto/vim9expr.pro
+++ b/src/proto/vim9expr.pro
@@ -2,7 +2,7 @@
int generate_ppconst(cctx_T *cctx, ppconst_T *ppconst);
void clear_ppconst(ppconst_T *ppconst);
int compile_member(int is_slice, int *keeping_dict, cctx_T *cctx);
-int compile_load_scriptvar(cctx_T *cctx, char_u *name, char_u *start, char_u **end, imported_T *import);
+int compile_load_scriptvar(cctx_T *cctx, char_u *name, char_u *start, char_u **end);
int compile_load(char_u **arg, char_u *end_arg, cctx_T *cctx, int is_expr, int error);
int compile_arguments(char_u **arg, cctx_T *cctx, int *argcount, ca_special_T special_fn);
char_u *to_name_end(char_u *arg, int use_namespace);
diff --git a/src/proto/vim9instr.pro b/src/proto/vim9instr.pro
index 8ee33b8..3fcf08c 100644
--- a/src/proto/vim9instr.pro
+++ b/src/proto/vim9instr.pro
@@ -81,6 +81,7 @@
int generate_store_var(cctx_T *cctx, assign_dest_T dest, int opt_flags, int vimvaridx, type_T *type, char_u *name, lhs_T *lhs);
int inside_loop_scope(cctx_T *cctx);
int generate_store_lhs(cctx_T *cctx, lhs_T *lhs, int instr_count, int is_decl);
+int generate_SCRIPTCTX_SET(cctx_T *cctx, sctx_T new_sctx);
void may_generate_prof_end(cctx_T *cctx, int prof_lnum);
void delete_instr(isn_T *isn);
void clear_instr_ga(garray_T *gap);