summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2002-07-29 15:56:53 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2002-07-29 15:56:53 (GMT)
commit75164b5a8a9172465a393abd3e3a6d9c7674e7d8 (patch)
tree3f080f45cb9304d12e125a5dcda51cac698ad730 /generic
parentedeb2f602f676509e74e81b4d65bb966dc28e395 (diff)
downloadtcl-75164b5a8a9172465a393abd3e3a6d9c7674e7d8.zip
tcl-75164b5a8a9172465a393abd3e3a6d9c7674e7d8.tar.gz
tcl-75164b5a8a9172465a393abd3e3a6d9c7674e7d8.tar.bz2
bugfix, new tests for new [interp alias] code
Diffstat (limited to 'generic')
-rw-r--r--generic/tcl.h4
-rw-r--r--generic/tclBasic.c18
-rw-r--r--generic/tclInterp.c6
-rw-r--r--generic/tclObj.c7
4 files changed, 20 insertions, 15 deletions
diff --git a/generic/tcl.h b/generic/tcl.h
index d090013..3e6e19c 100644
--- a/generic/tcl.h
+++ b/generic/tcl.h
@@ -13,7 +13,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tcl.h,v 1.137 2002/07/29 00:25:49 msofer Exp $
+ * RCS: @(#) $Id: tcl.h,v 1.138 2002/07/29 15:56:53 msofer Exp $
*/
#ifndef _TCL
@@ -984,7 +984,7 @@ typedef struct Tcl_DString {
#define TCL_NO_EVAL 0x10000
#define TCL_EVAL_GLOBAL 0x20000
#define TCL_EVAL_DIRECT 0x40000
-#define TCL_EVAL_NO_TRACEBACK 0x80000
+#define TCL_EVAL_INVOKE 0x80000
/*
* Special freeProc values that may be passed to Tcl_SetResult (see
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index ef2a29c..e927654 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -13,7 +13,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclBasic.c,v 1.66 2002/07/29 00:25:49 msofer Exp $
+ * RCS: @(#) $Id: tclBasic.c,v 1.67 2002/07/29 15:56:53 msofer Exp $
*/
#include "tclInt.h"
@@ -2926,8 +2926,8 @@ TclEvalObjvInternal(interp, objc, objv, command, length, flags)
* used. */
int flags; /* Collection of OR-ed bits that control
* the evaluation of the script. Only
- * TCL_EVAL_GLOBAL is currently
- * supported. */
+ * TCL_EVAL_GLOBAL and TCL_EVAL_INVOKE are
+ * currently supported. */
{
Command *cmdPtr;
@@ -2957,8 +2957,14 @@ TclEvalObjvInternal(interp, objc, objv, command, length, flags)
* command words as arguments. Then call ourselves recursively
* to execute it.
*/
-
+
+ savedVarFramePtr = iPtr->varFramePtr;
+ if (flags & TCL_EVAL_INVOKE) {
+ iPtr->varFramePtr = NULL;
+ }
cmdPtr = (Command *) Tcl_GetCommandFromObj(interp, objv[0]);
+ iPtr->varFramePtr = savedVarFramePtr;
+
if (cmdPtr == NULL) {
newObjv = (Tcl_Obj **) ckalloc((unsigned)
((objc + 1) * sizeof (Tcl_Obj *)));
@@ -3101,7 +3107,7 @@ Tcl_EvalObjv(interp, objc, objv, flags)
* the words that make up the command. */
int flags; /* Collection of OR-ed bits that control
* the evaluation of the script. Only
- * TCL_EVAL_GLOBAL and TCL_EVAL_NO_TRACEBACK
+ * TCL_EVAL_GLOBAL and TCL_EVAL_INVOKE
* are currently supported. */
{
Interp *iPtr = (Interp *)interp;
@@ -3158,7 +3164,7 @@ Tcl_EvalObjv(interp, objc, objv, flags)
}
}
- if ((code == TCL_ERROR) && !(flags & TCL_EVAL_NO_TRACEBACK)) {
+ if ((code == TCL_ERROR) && !(flags & TCL_EVAL_INVOKE)) {
/*
* If there was an error, a command string will be needed for the
diff --git a/generic/tclInterp.c b/generic/tclInterp.c
index 65c41d9..06d81fe 100644
--- a/generic/tclInterp.c
+++ b/generic/tclInterp.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclInterp.c,v 1.13 2002/07/29 00:25:49 msofer Exp $
+ * RCS: @(#) $Id: tclInterp.c,v 1.14 2002/07/29 15:56:54 msofer Exp $
*/
#include "tclInt.h"
@@ -1452,11 +1452,11 @@ AliasObjCmd(clientData, interp, objc, objv)
if (targetInterp != interp) {
Tcl_Preserve((ClientData) targetInterp);
- result = Tcl_EvalObjv(targetInterp, cmdc, cmdv, TCL_EVAL_NO_TRACEBACK);
+ result = Tcl_EvalObjv(targetInterp, cmdc, cmdv, TCL_EVAL_INVOKE);
TclTransferResult(targetInterp, result, interp);
Tcl_Release((ClientData) targetInterp);
} else {
- result = Tcl_EvalObjv(targetInterp, cmdc, cmdv, TCL_EVAL_NO_TRACEBACK);
+ result = Tcl_EvalObjv(targetInterp, cmdc, cmdv, TCL_EVAL_INVOKE);
}
if (cmdv != cmdArr) {
diff --git a/generic/tclObj.c b/generic/tclObj.c
index 9dc2b90..926fa9f 100644
--- a/generic/tclObj.c
+++ b/generic/tclObj.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclObj.c,v 1.33 2002/04/26 08:34:35 dkf Exp $
+ * RCS: @(#) $Id: tclObj.c,v 1.34 2002/07/29 15:56:54 msofer Exp $
*/
#include "tclInt.h"
@@ -2852,9 +2852,8 @@ Tcl_GetCommandFromObj(interp, objPtr)
register Tcl_Obj *objPtr; /* The object containing the command's
* name. If the name starts with "::", will
* be looked up in global namespace. Else,
- * looked up first in the current namespace
- * if contextNsPtr is NULL, then in global
- * namespace. */
+ * looked up first in the current namespace,
+ * then in global namespace. */
{
Interp *iPtr = (Interp *) interp;
register ResolvedCmdName *resPtr;