From: SourceForge.net <no...@so...> - 2007-06-05 17:33:21
|
Bugs item #1649062, was opened at 2007-01-31 12:39 Message generated for change (Comment added) made by dgp You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=1649062&group_id=10894 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: 18. Commands M-Z Group: current: 8.5a6 Status: Open Resolution: None Priority: 5 Private: No Submitted By: Bryan Oakley (boakley) Assigned to: Don Porter (dgp) Summary: incompat in ::errorInfo/::errorCode maintenance Initial Comment: It appears that in 8.4.14 (I don't know about earlier versions...) "return -code error -errorcode xxx" doesn't work. The proper behavior (IMO) is seen in 8.5a4 FWIW. It is the "-errorcode xxx" part that doesn't seem to work. I expect to get the same results whether I use "return -code error" or "error" but I get different results on 8.4.14 with the following code (on Windows XP): proc main {} { foo return foo error } proc foo {what} { set ::errorCode NULL set ::errorInfo "" if {[catch { if {$what == "error"} { error \ "error reported via error" \ "custom errorInfo" \ [list CUSTOM errorCode] } else { return \ -code error \ -errorinfo "custom errorInfo" \ -errorcode [list CUSTOM errorCode] \ "error reported via return" } } err]} { puts $err: puts " errorCode: $::errorCode" puts " errorInfo: $::errorInfo" puts "" } } main exit 0 Here is what I get with 8.4.14: error reported via error: errorCode: CUSTOM errorCode errorInfo: custom errorInfo error reported via return: errorCode: NULL errorInfo: This is what I get with 8.5a4: error reported via error: errorCode: CUSTOM errorCode errorInfo: custom errorInfo error reported via return: errorCode: CUSTOM errorCode errorInfo: custom errorInfo ---------------------------------------------------------------------- >Comment By: Don Porter (dgp) Date: 2007-06-05 13:33 Message: Logged In: YES user_id=80530 Originator: NO patch updated to HEAD File Added: 1649062.patch ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2007-02-01 12:08 Message: Logged In: YES user_id=80530 Originator: NO The attached patch for the Tcl HEAD corrects the incompatiblity in maintenance of the legacy variables ::errorCode and ::errorInfo that is demonstrated in the report. I don't really like the patch much, since it adds a flag bit to iPtr->flags. In 8.5 I've been trying to remove such things, not add them. But, if this incompat is important, I suppose a flag to get this legacy support right isn't too bad. File Added: legacy.patch ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=1649062&group_id=10894 |