Skip to content

Commit 9392ba4

Browse files
committed
Merge 8.6 branch
2 parents 0a1c7ac + 8753e11 commit 9392ba4

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

doc/object.n

+5
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ The \fBoo::object\fR class supports the following non-exported methods:
6464
This method concatenates the arguments, \fIarg\fR, as if with \fBconcat\fR,
6565
and then evaluates the resulting script in the namespace that is uniquely
6666
associated with \fIobj\fR, returning the result of the evaluation.
67+
.RS
68+
.PP
69+
Note that object-internal commands such as \fBmy\fR and \fBself\fR can be
70+
invoked in this context.
71+
.RE
6772
.TP
6873
\fIobj \fBunknown ?\fImethodName\fR? ?\fIarg ...\fR?
6974
.

generic/tclOOBasic.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,8 @@ TclOO_Object_Eval(
442442
*/
443443

444444
(void) TclPushStackFrame(interp, (Tcl_CallFrame **) framePtrPtr,
445-
Tcl_GetObjectNamespace(object), 0);
445+
Tcl_GetObjectNamespace(object), FRAME_IS_METHOD);
446+
framePtr->clientData = context;
446447
framePtr->objc = objc;
447448
framePtr->objv = objv; /* Reference counts do not need to be
448449
* incremented here. */

tests/oo.test

+10
Original file line numberDiff line numberDiff line change
@@ -3002,6 +3002,16 @@ test oo-18.11 {OO: define/self command support} -setup {
30023002
(in definition script for class "::foo" line 1)
30033003
invoked from within
30043004
"oo::define foo {rename ::foo {}; self {error foobar}}"}
3005+
test oo-18.12 {OO: self callable via eval method} -setup {
3006+
oo::class create parent {
3007+
export eval
3008+
}
3009+
parent create ::foo
3010+
} -body {
3011+
foo eval { self }
3012+
} -cleanup {
3013+
parent destroy
3014+
} -result ::foo
30053015

30063016
test oo-19.1 {OO: varname method} -setup {
30073017
oo::object create inst

0 commit comments

Comments
 (0)