summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2004-10-22 15:46:35 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2004-10-22 15:46:35 (GMT)
commit231f5f3d5b6c01e9bc38fee95c93db53a52ae90b (patch)
tree2b1ce72582368d79e806e39bedf41e591514bd7e
parent9f2e0752a6f6ab07ff0b2411c9a945ba52804aff (diff)
downloadtcl-231f5f3d5b6c01e9bc38fee95c93db53a52ae90b.zip
tcl-231f5f3d5b6c01e9bc38fee95c93db53a52ae90b.tar.gz
tcl-231f5f3d5b6c01e9bc38fee95c93db53a52ae90b.tar.bz2
Make ensembles report shorter error traces that conceal more of how the
ensemble implements itself. This is usually the right thing to do.
-rw-r--r--ChangeLog6
-rw-r--r--generic/tclNamesp.c5
-rw-r--r--tests/namespace.test12
3 files changed, 14 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 1b414ae..14afafb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-10-22 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * generic/tclNamesp.c (NsEnsembleImplementationCmd): Make
+ ensembles cut their implementations out of error traces. This is
+ the right thing to do more often than not.
+
2004-10-22 Kevin B. Kenny <kennykb@acm.org>
* library/clock.tcl: Fixed a typo where the fallback time zone
diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c
index 6b606f0..38c5dd7 100644
--- a/generic/tclNamesp.c
+++ b/generic/tclNamesp.c
@@ -21,7 +21,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclNamesp.c,v 1.62 2004/10/15 04:01:32 dgp Exp $
+ * RCS: @(#) $Id: tclNamesp.c,v 1.63 2004/10/22 15:46:37 dkf Exp $
*/
#include "tclInt.h"
@@ -5049,7 +5049,8 @@ NsEnsembleImplementationCmd(clientData, interp, objc, objv)
tempObjv = (Tcl_Obj **) ckalloc(sizeof(Tcl_Obj *)*(objc-2+prefixObjc));
memcpy(tempObjv, prefixObjv, sizeof(Tcl_Obj *) * prefixObjc);
memcpy(tempObjv+prefixObjc, objv+2, sizeof(Tcl_Obj *) * (objc-2));
- result = Tcl_EvalObjv(interp, objc-2+prefixObjc, tempObjv, 0);
+ result = Tcl_EvalObjv(interp, objc-2+prefixObjc, tempObjv,
+ TCL_EVAL_INVOKE);
Tcl_DecrRefCount(prefixObj);
ckfree((char *)tempObjv);
return result;
diff --git a/tests/namespace.test b/tests/namespace.test
index ce99f75..cc31389 100644
--- a/tests/namespace.test
+++ b/tests/namespace.test
@@ -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: namespace.test,v 1.40 2004/10/02 04:21:49 dgp Exp $
+# RCS: @(#) $Id: namespace.test,v 1.41 2004/10/22 15:46:37 dkf Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest 2
@@ -1691,14 +1691,12 @@ test namespace-46.4 {ensemble: implementation errors} {
} {ns 1 {unknown subcommand "?": namespace ::ns does not export any commands}}
test namespace-46.5 {ensemble: implementation errors} {
namespace eval ns {
- namespace ensemble create -map {foo ::error}
+ namespace ensemble create -map {makeError ::error}
}
- list [catch {ns foo bar} msg] $msg $::errorInfo [namespace delete ns]
-} {1 bar {bar
+ list [catch {ns makeError "an error happened"} msg] $msg $::errorInfo [namespace delete ns]
+} {1 {an error happened} {an error happened
while executing
-"::error bar"
- invoked from within
-"ns foo bar"} {}}
+"ns makeError "an error happened""} {}}
test namespace-46.6 {ensemble: implementation renames/deletes itself} {
namespace eval ns {
namespace ensemble create -map {to ::rename}