summaryrefslogtreecommitdiffstats
path: root/generic/tclCompCmdsSZ.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/tclCompCmdsSZ.c
parent05f862b0622794e90c90544b62b929ac0f47753c (diff)
downloadtcl-419d5645c272033992ce63a5c714a64436e9f189.zip
tcl-419d5645c272033992ce63a5c714a64436e9f189.tar.gz
tcl-419d5645c272033992ce63a5c714a64436e9f189.tar.bz2
[Freq 2974744] share exception codes (ObjType?)
Diffstat (limited to 'generic/tclCompCmdsSZ.c')
-rw-r--r--generic/tclCompCmdsSZ.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/generic/tclCompCmdsSZ.c b/generic/tclCompCmdsSZ.c
index d8fdcd1..b19dfc8 100644
--- a/generic/tclCompCmdsSZ.c
+++ b/generic/tclCompCmdsSZ.c
@@ -14,7 +14,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclCompCmdsSZ.c,v 1.6 2010/03/23 12:58:39 nijtmans Exp $
+ * RCS: @(#) $Id: tclCompCmdsSZ.c,v 1.7 2010/03/27 22:40:14 nijtmans Exp $
*/
#include "tclInt.h"
@@ -1992,9 +1992,6 @@ TclCompileTryCmd(
} else if (tokenPtr[1].size == 2
&& !strncmp(tokenPtr[1].start, "on", 2)) {
int code;
- static const char *const returnCodes[] = {
- "ok", "error", "return", "break", "continue", NULL
- };
/*
* Parse the result code to look for.
@@ -2007,9 +2004,7 @@ TclCompileTryCmd(
TclDecrRefCount(tmpObj);
goto failedToCompile;
}
- if (Tcl_GetIntFromObj(NULL, tmpObj, &code) != TCL_OK
- && Tcl_GetIndexFromObj(NULL, tmpObj, returnCodes, "",
- TCL_EXACT, &code) != TCL_OK) {
+ if (TCL_ERROR == TclGetCompletionCodeFromObj(NULL, tmpObj, &code)) {
TclDecrRefCount(tmpObj);
goto failedToCompile;
}