Tcl Source Code

Artifact [582e3fd2e3]
Login

Artifact 582e3fd2e3122681dbb1842fe85c19e101c8712b:

Attachment "926590.patch" to ticket [926590ffff] added by msofer 2004-05-04 06:43:48.
? generic/tclObj.c.ORIG
? generic/tclProc.c.ORIG
? unix/.log
? unix/.ofl
? unix/ERR
? unix/dir.file
? unix/dltest.marker
? unix/gorp.file
? unix/tclsh-head
? unix/tclsh-noAsync
? unix/tclsh-noStart
? unix/touch.me?
? unix/x.log
? unix/x.ofl
Index: doc/interp.n
===================================================================
RCS file: /cvsroot/tcl/tcl/doc/interp.n,v
retrieving revision 1.10
diff -u -r1.10 interp.n
--- doc/interp.n	28 Feb 2004 15:45:53 -0000	1.10
+++ doc/interp.n	3 May 2004 23:42:29 -0000
@@ -160,7 +160,8 @@
 \fBinterp\fR \fBeval\fR \fIpath arg \fR?\fIarg ...\fR?
 This command concatenates all of the \fIarg\fR arguments in the same
 fashion as the \fBconcat\fR command, then evaluates the resulting string as
-a Tcl script in the slave interpreter identified by \fIpath\fR. The result
+a Tcl script in the slave interpreter identified by \fIpath\fR, in the
+current context of the slave. The result
 of this evaluation (including error information such as the \fBerrorInfo\fR
 and \fBerrorCode\fR variables, if an error occurs) is returned to the
 invoking interpreter.
@@ -315,7 +316,8 @@
 \fIslave \fBeval \fIarg \fR?\fIarg ..\fR?
 This command concatenates all of the \fIarg\fR arguments in
 the same fashion as the \fBconcat\fR command, then evaluates
-the resulting string as a Tcl script in \fIslave\fR.
+the resulting string as a Tcl script in \fIslave\fR, in the
+current context of the slave.
 The result of this evaluation (including error information
 such as the \fBerrorInfo\fR and \fBerrorCode\fR variables, if an
 error occurs) is returned to the invoking interpreter.
Index: tests/interp.test
===================================================================
RCS file: /cvsroot/tcl/tcl/tests/interp.test,v
retrieving revision 1.27
diff -u -r1.27 interp.test
--- tests/interp.test	30 Mar 2004 16:22:22 -0000	1.27
+++ tests/interp.test	3 May 2004 23:42:29 -0000
@@ -234,6 +234,16 @@
 test interp-6.6 {testing eval} {
     list [catch {interp eval {a x2} foo} msg] $msg
 } {1 {invalid command name "foo"}}
+test interp-6.7 {testing scope of eval, Bug 926590} {
+    a eval set b 1
+    a eval [list proc foo {} {set b 2; bar}]
+    a alias bar bar 
+    proc bar {} {a eval set b}
+    set msg [list [bar] [a eval bar] [a eval foo]]
+    a eval {unset b; rename foo {}; rename bar {}}
+    rename bar {}
+    set msg
+} {1 1 2}
 
 # UTILITY PROCEDURE RUNNING IN MASTER INTERPRETER:
 proc in_master {args} {