From: SourceForge.net <no...@so...> - 2010-01-21 09:30:57
|
Bugs item #2935779, was opened at 2010-01-20 20:57 Message generated for change (Comment added) made by dzach You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=2935779&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: 47. Bytecode Compiler Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: dzach (dzach) Assigned to: Don Porter (dgp) Summary: Inaccuracy in docs for [catch] option -errorline Initial Comment: The documentation states: "catch script ?resultVarName? ?optionsVarName?" ... "The value of the -errorline entry is an integer indicating which line of script was being evaluated when the error occurred." However, if one runs some [catch] code inside a proc, the -errorline integer indicates the line of the proc script that has the error and not the line of the catch script, as is stated in the doc. The following code shows the problem: proc test {} { puts inside...\[test] puts "some more text" switch {} { default { catch { puts "inside script" sdfsdf # the error } err opt } } puts $err puts $opt } % test inside...[test] some more text inside script invalid command name "sdfsdf" -code 1 -level 0 -errorcode NONE -errorinfo {invalid command name "sdfsdf" while executing "sdfsdf # the error"} -errorline 8 instead of -errorline 3 ---------------------------------------------------------------------- >Comment By: dzach (dzach) Date: 2010-01-21 11:30 Message: I don't call it a bug because I find the functionality correct and as expected, only the docs say it should be different. The way it works now helps pinpoint the error line within the [proc] script, with a simple [info body]. ---------------------------------------------------------------------- Comment By: dzach (dzach) Date: 2010-01-21 04:27 Message: Release: Tcl8.6b1.1 / Tk8.6b1.1 Same problem with: Tcl8.5a6 / Tk8.5a6 but not with Tcl8.4.16 / Tk8.4.16 since [catch] options were introduced in 8.5 I think. ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2010-01-21 04:15 Message: That's a bug then, not mistaken docs. Please state precisely what release you see this buggy behavior in, and whether or not it is a regression from earlier releases that got things right. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=2935779&group_id=10894 |