diff options
author | dgp <dgp@users.sourceforge.net> | 2003-05-05 20:54:37 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2003-05-05 20:54:37 (GMT) |
commit | 0141bbbd2f31ab6734963fd5e653f1a5a93b646d (patch) | |
tree | 333cb75d8427317c3ad375ecbbf91791916f6817 /generic/tclBasic.c | |
parent | 5940eaeb9273d7c2c5eaa2e9db99cf403eb3a8fa (diff) | |
download | tcl-0141bbbd2f31ab6734963fd5e653f1a5a93b646d.zip tcl-0141bbbd2f31ab6734963fd5e653f1a5a93b646d.tar.gz tcl-0141bbbd2f31ab6734963fd5e653f1a5a93b646d.tar.bz2 |
* generic/tclBasic.c: Implementation of TIP 90, which
* generic/tclCmdAH.c: extends the [catch] and [return]
* generic/tclCompCmds.c: commands to enable creation of a
* generic/tclExecute.c: proc that is a replacement for
* generic/tclInt.h: [return]. [Patch 531640]
* generic/tclProc.c:
* generic/tclResult.c:
* tests/cmdAH.test:
* tests/cmdMZ.test:
* tests/error.test:
* tests/proc-old.test:
* library/tcltest/tcltest.tcl: The -returnCodes option to [test]
failed to recognize the symbolic name "ok" for return code 0.
Diffstat (limited to 'generic/tclBasic.c')
-rw-r--r-- | generic/tclBasic.c | 42 |
1 files changed, 30 insertions, 12 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c index bd8efdc..5551c45 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.80 2003/05/05 16:48:54 dkf Exp $ + * RCS: @(#) $Id: tclBasic.c,v 1.81 2003/05/05 20:54:38 dgp Exp $ */ #include "tclInt.h" @@ -337,9 +337,27 @@ Tcl_CreateInterp() iPtr->framePtr = NULL; iPtr->varFramePtr = NULL; iPtr->activeVarTracePtr = NULL; - iPtr->returnCode = TCL_OK; - iPtr->errorInfo = NULL; - iPtr->errorCode = NULL; + + iPtr->returnCodeKey = Tcl_NewStringObj("-code",-1); + Tcl_IncrRefCount(iPtr->returnCodeKey); + iPtr->returnErrorcodeKey = Tcl_NewStringObj("-errorcode",-1); + Tcl_IncrRefCount(iPtr->returnErrorcodeKey); + iPtr->returnErrorinfoKey = Tcl_NewStringObj("-errorinfo",-1); + Tcl_IncrRefCount(iPtr->returnErrorinfoKey); + iPtr->returnErrorlineKey = Tcl_NewStringObj("-errorline",-1); + Tcl_IncrRefCount(iPtr->returnErrorlineKey); + iPtr->returnLevelKey = Tcl_NewStringObj("-level",-1); + Tcl_IncrRefCount(iPtr->returnLevelKey); + iPtr->returnOptionsKey = Tcl_NewStringObj("-options",-1); + Tcl_IncrRefCount(iPtr->returnOptionsKey); + iPtr->defaultReturnOpts = Tcl_NewDictObj(); + Tcl_DictObjPut(NULL, iPtr->defaultReturnOpts, + iPtr->returnCodeKey, Tcl_NewIntObj(TCL_OK)); + Tcl_DictObjPut(NULL, iPtr->defaultReturnOpts, + iPtr->returnLevelKey, Tcl_NewIntObj(1)); + Tcl_IncrRefCount(iPtr->defaultReturnOpts); + iPtr->returnOpts = iPtr->defaultReturnOpts; + Tcl_IncrRefCount(iPtr->returnOpts); iPtr->appendResult = NULL; iPtr->appendAvl = 0; @@ -1062,14 +1080,14 @@ DeleteInterpProc(interp) interp->result = NULL; Tcl_DecrRefCount(iPtr->objResultPtr); iPtr->objResultPtr = NULL; - if (iPtr->errorInfo != NULL) { - ckfree(iPtr->errorInfo); - iPtr->errorInfo = NULL; - } - if (iPtr->errorCode != NULL) { - ckfree(iPtr->errorCode); - iPtr->errorCode = NULL; - } + Tcl_DecrRefCount(iPtr->returnOpts); + Tcl_DecrRefCount(iPtr->defaultReturnOpts); + Tcl_DecrRefCount(iPtr->returnCodeKey); + Tcl_DecrRefCount(iPtr->returnErrorcodeKey); + Tcl_DecrRefCount(iPtr->returnErrorinfoKey); + Tcl_DecrRefCount(iPtr->returnErrorlineKey); + Tcl_DecrRefCount(iPtr->returnLevelKey); + Tcl_DecrRefCount(iPtr->returnOptionsKey); if (iPtr->appendResult != NULL) { ckfree(iPtr->appendResult); iPtr->appendResult = NULL; |