summaryrefslogtreecommitdiffstats
path: root/generic/tclNamesp.c
diff options
context:
space:
mode:
authorandreas_kupries <akupries@shaw.ca>2008-07-21 22:50:30 (GMT)
committerandreas_kupries <akupries@shaw.ca>2008-07-21 22:50:30 (GMT)
commitd0b609270a5168026fc5df405c4245ae2e33deed (patch)
tree29f73567f546804a17604f4a80c01c4551d51979 /generic/tclNamesp.c
parent57bdff7e68cb1e0fe66a2671b18ce67ecbb79e69 (diff)
downloadtcl-d0b609270a5168026fc5df405c4245ae2e33deed.zip
tcl-d0b609270a5168026fc5df405c4245ae2e33deed.tar.gz
tcl-d0b609270a5168026fc5df405c4245ae2e33deed.tar.bz2
* generic/tclBasic.c: Extended the existing TIP #280 system (info
* generic/tclCmdAH.c: frame), added the ability to track the * generic/tclCompCmds.c: absolute location of literal procedure * generic/tclCompile.c: arguments, and making this information * generic/tclCompile.h: available to uplevel, eval, and * generic/tclInterp.c: siblings. This allows proper tracking of * generic/tclInt.h: absolute location through custom (Tcl-coded) * generic/tclNamesp.c: control structures based on uplevel, etc. * generic/tclProc.c: * tests/info.test:
Diffstat (limited to 'generic/tclNamesp.c')
-rw-r--r--generic/tclNamesp.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c
index cf7e250..3eda959 100644
--- a/generic/tclNamesp.c
+++ b/generic/tclNamesp.c
@@ -23,7 +23,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclNamesp.c,v 1.170 2008/07/21 16:26:08 msofer Exp $
+ * RCS: @(#) $Id: tclNamesp.c,v 1.171 2008/07/21 22:50:36 andreas_kupries Exp $
*/
#include "tclInt.h"
@@ -3265,6 +3265,8 @@ NamespaceEvalCmd(
Tcl_Obj *const objv[]) /* Argument objects. */
{
Interp *iPtr = (Interp *) interp;
+ CmdFrame* invoker;
+ int word;
Tcl_Namespace *namespacePtr;
CallFrame *framePtr, **framePtrPtr;
Tcl_Obj *objPtr;
@@ -3312,7 +3314,14 @@ NamespaceEvalCmd(
framePtr->objv = objv;
if (objc == 4) {
- objPtr = objv[3];
+ /*
+ * TIP #280: Make actual argument location available to eval'd script.
+ */
+
+ objPtr = objv[3];
+ invoker = iPtr->cmdFramePtr;
+ word = 3;
+ TclArgumentGet (interp, objPtr, &invoker, &word);
} else {
/*
* More than one argument: concatenate them together with spaces
@@ -3320,7 +3329,9 @@ NamespaceEvalCmd(
* object when it decrements its refcount after eval'ing it.
*/
- objPtr = Tcl_ConcatObj(objc-3, objv+3);
+ objPtr = Tcl_ConcatObj(objc-3, objv+3);
+ invoker = NULL;
+ word = 0;
}
/*
@@ -3329,7 +3340,7 @@ NamespaceEvalCmd(
TclNRAddCallback(interp, NsEval_Callback, namespacePtr, "eval",
NULL, NULL);
- return TclNREvalObjEx(interp, objPtr, 0, iPtr->cmdFramePtr, 3);
+ return TclNREvalObjEx(interp, objPtr, 0, invoker, word);
}
static int