summaryrefslogtreecommitdiffstats
path: root/generic/tclCmdMZ.c
diff options
context:
space:
mode:
authornijtmans <nijtmans>2010-03-27 22:40:13 (GMT)
committernijtmans <nijtmans>2010-03-27 22:40:13 (GMT)
commit419d5645c272033992ce63a5c714a64436e9f189 (patch)
treeea1e97233f6104789908e88752e680e1fa3959dc /generic/tclCmdMZ.c
parent05f862b0622794e90c90544b62b929ac0f47753c (diff)
downloadtcl-419d5645c272033992ce63a5c714a64436e9f189.zip
tcl-419d5645c272033992ce63a5c714a64436e9f189.tar.gz
tcl-419d5645c272033992ce63a5c714a64436e9f189.tar.bz2
[Freq 2974744] share exception codes (ObjType?)
Diffstat (limited to 'generic/tclCmdMZ.c')
-rw-r--r--generic/tclCmdMZ.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c
index e63e07c..618bb6b 100644
--- a/generic/tclCmdMZ.c
+++ b/generic/tclCmdMZ.c
@@ -15,7 +15,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclCmdMZ.c,v 1.209 2010/03/24 10:25:59 dkf Exp $
+ * RCS: @(#) $Id: tclCmdMZ.c,v 1.210 2010/03/27 22:40:13 nijtmans Exp $
*/
#include "tclInt.h"
@@ -4165,9 +4165,6 @@ TclNRTryObjCmd(
enum Handlers {
TryFinally, TryOn, TryTrap
};
- static const char *const returnCodes[] = {
- "ok", "error", "return", "break", "continue", NULL
- };
/*
* Parse the arguments. The handlers are passed to subsequent callbacks as
@@ -4217,15 +4214,7 @@ TclNRTryObjCmd(
Tcl_DecrRefCount(handlersObj);
return TCL_ERROR;
}
- if (Tcl_GetIntFromObj(NULL, objv[i+1], &code) != TCL_OK
- && Tcl_GetIndexFromObj(NULL, objv[i+1], returnCodes,
- "code", 0, &code) != TCL_OK) {
- Tcl_ResetResult(interp);
- Tcl_AppendResult(interp, "bad completion code \"",
- TclGetString(objv[i+1]),
- "\": must be ok, error, return, break, "
- "continue, or an integer", NULL);
- Tcl_SetErrorCode(interp, "TCL", "RESULT", "ILLEGAL_CODE", NULL);
+ if (TCL_ERROR == TclGetCompletionCodeFromObj(interp, objv[i+1], &code)) {
Tcl_DecrRefCount(handlersObj);
return TCL_ERROR;
}