summaryrefslogtreecommitdiff
path: root/src/vim9class.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vim9class.c')
-rw-r--r--src/vim9class.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/vim9class.c b/src/vim9class.c
index 0262e025d..484500576 100644
--- a/src/vim9class.c
+++ b/src/vim9class.c
@@ -1388,6 +1388,19 @@ class_member_index(char_u *name, size_t len, class_T **cl_ret, cctx_T *cctx)
}
/*
+ * Return TRUE if current context "cctx_arg" is inside class "cl".
+ * Return FALSE if not.
+ */
+ int
+inside_class(cctx_T *cctx_arg, class_T *cl)
+{
+ for (cctx_T *cctx = cctx_arg; cctx != NULL; cctx = cctx->ctx_outer)
+ if (cctx->ctx_ufunc != NULL && cctx->ctx_ufunc->uf_class == cl)
+ return TRUE;
+ return FALSE;
+}
+
+/*
* Make a copy of an object.
*/
void