summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2024-07-18 14:53:18 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2024-07-18 14:53:18 (GMT)
commit155a3b6269b213f6a9e1c982c32a526847b29e05 (patch)
treee36d1a7ddabfde194172f94413ffe298b7b172c6
parent80901eab86b5a1437e486a3d946080140319b734 (diff)
parent01d879a8f4238ac0b1c4d82c5490ab4ae51ad400 (diff)
downloadtcl-155a3b6269b213f6a9e1c982c32a526847b29e05.zip
tcl-155a3b6269b213f6a9e1c982c32a526847b29e05.tar.gz
tcl-155a3b6269b213f6a9e1c982c32a526847b29e05.tar.bz2
Merge 8.6 branch
-rw-r--r--doc/object.n5
-rw-r--r--generic/tclOOBasic.c3
-rw-r--r--tests/oo.test10
3 files changed, 17 insertions, 1 deletions
diff --git a/doc/object.n b/doc/object.n
index 98679d1..7bdbbe2 100644
--- a/doc/object.n
+++ b/doc/object.n
@@ -64,6 +64,11 @@ The \fBoo::object\fR class supports the following non-exported methods:
This method concatenates the arguments, \fIarg\fR, as if with \fBconcat\fR,
and then evaluates the resulting script in the namespace that is uniquely
associated with \fIobj\fR, returning the result of the evaluation.
+.RS
+.PP
+Note that object-internal commands such as \fBmy\fR and \fBself\fR can be
+invoked in this context.
+.RE
.TP
\fIobj \fBunknown ?\fImethodName\fR? ?\fIarg ...\fR?
.
diff --git a/generic/tclOOBasic.c b/generic/tclOOBasic.c
index 7b4ad5c..ac90e36 100644
--- a/generic/tclOOBasic.c
+++ b/generic/tclOOBasic.c
@@ -442,7 +442,8 @@ TclOO_Object_Eval(
*/
(void) TclPushStackFrame(interp, (Tcl_CallFrame **) framePtrPtr,
- Tcl_GetObjectNamespace(object), 0);
+ Tcl_GetObjectNamespace(object), FRAME_IS_METHOD);
+ framePtr->clientData = context;
framePtr->objc = objc;
framePtr->objv = objv; /* Reference counts do not need to be
* incremented here. */
diff --git a/tests/oo.test b/tests/oo.test
index 0838827..8d5fc3e 100644
--- a/tests/oo.test
+++ b/tests/oo.test
@@ -3002,6 +3002,16 @@ test oo-18.11 {OO: define/self command support} -setup {
(in definition script for class "::foo" line 1)
invoked from within
"oo::define foo {rename ::foo {}; self {error foobar}}"}
+test oo-18.12 {OO: self callable via eval method} -setup {
+ oo::class create parent {
+ export eval
+ }
+ parent create ::foo
+} -body {
+ foo eval { self }
+} -cleanup {
+ parent destroy
+} -result ::foo
test oo-19.1 {OO: varname method} -setup {
oo::object create inst