summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2010-07-15 21:00:25 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2010-07-15 21:00:25 (GMT)
commit83badefdb71b863f0580d1ee3d6270c5102ba3d9 (patch)
tree6b04ba25316f8d4a973365fa0f061d7d270ff626 /generic
parent7abfdd1acbbaf999810374d70a5b9423b898fb00 (diff)
downloadtcl-83badefdb71b863f0580d1ee3d6270c5102ba3d9.zip
tcl-83badefdb71b863f0580d1ee3d6270c5102ba3d9.tar.gz
tcl-83badefdb71b863f0580d1ee3d6270c5102ba3d9.tar.bz2
* generic/tclExecute.c (TclExecuteByteCode): Ensure that [dict get]
* generic/tclDictObj.c (DictGetCmd): always generates an errorCode on a failure to look up an entry.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclDictObj.c6
-rw-r--r--generic/tclExecute.c4
2 files changed, 7 insertions, 3 deletions
diff --git a/generic/tclDictObj.c b/generic/tclDictObj.c
index e0aea5b..a2a8dd0 100644
--- a/generic/tclDictObj.c
+++ b/generic/tclDictObj.c
@@ -4,12 +4,12 @@
* This file contains functions that implement the Tcl dict object type
* and its accessor command.
*
- * Copyright (c) 2002 by Donal K. Fellows.
+ * Copyright (c) 2002-2010 by Donal K. Fellows.
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclDictObj.c,v 1.82 2010/03/05 14:34:04 dkf Exp $
+ * RCS: @(#) $Id: tclDictObj.c,v 1.83 2010/07/15 21:00:26 dkf Exp $
*/
#include "tclInt.h"
@@ -1621,6 +1621,8 @@ DictGetCmd(
Tcl_ResetResult(interp);
Tcl_AppendResult(interp, "key \"", TclGetString(objv[objc-1]),
"\" not known in dictionary", NULL);
+ Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "DICT",
+ TclGetString(objv[objc-1]), NULL);
return TCL_ERROR;
}
Tcl_SetObjResult(interp, valuePtr);
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 95e036b..73185b8 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.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: tclExecute.c,v 1.487 2010/07/02 20:37:10 dkf Exp $
+ * RCS: @(#) $Id: tclExecute.c,v 1.488 2010/07/15 21:00:26 dkf Exp $
*/
#include "tclInt.h"
@@ -5818,6 +5818,8 @@ TclExecuteByteCode(
Tcl_ResetResult(interp);
Tcl_AppendResult(interp, "key \"", TclGetString(OBJ_AT_TOS),
"\" not known in dictionary", NULL);
+ Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "DICT",
+ TclGetString(OBJ_AT_TOS), NULL);
TRACE_WITH_OBJ(("%u => ERROR ", opnd), Tcl_GetObjResult(interp));
} else {
TRACE_WITH_OBJ((