diff options
author | hobbs <hobbs@noemail.net> | 2000-01-21 03:40:03 (GMT) |
---|---|---|
committer | hobbs <hobbs@noemail.net> | 2000-01-21 03:40:03 (GMT) |
commit | 40c6211549c1d289376a50cea64d9646a16aa358 (patch) | |
tree | 869760d15dcf8205bfede3c5cfcd6398638fe45b /tests | |
parent | 7ddf5074dfd0d363a565036a5f7fcf64ac173497 (diff) | |
download | tcl-40c6211549c1d289376a50cea64d9646a16aa358.zip tcl-40c6211549c1d289376a50cea64d9646a16aa358.tar.gz tcl-40c6211549c1d289376a50cea64d9646a16aa358.tar.bz2 |
added test for [info body] bytecompiled object bug
FossilOrigin-Name: f5acbfc92950a82abb6f0beddc5d46caf595e460
Diffstat (limited to 'tests')
-rw-r--r-- | tests/info.test | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/tests/info.test b/tests/info.test index a9ba98b..f8fdd43 100644 --- a/tests/info.test +++ b/tests/info.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: info.test,v 1.13 2000/01/12 11:13:25 hobbs Exp $ +# RCS: @(#) $Id: info.test,v 1.14 2000/01/21 03:40:04 hobbs Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -79,6 +79,21 @@ test info-2.4 {info body option} { list [info body p] [info body q] } } {{return "x=$x"} {return "y=$y"}} +test info-2.5 {info body option, returning bytecompiled bodies} { + # Prior to 8.3.0 this would cause a crash because [info body] + # would return the bytecompiled version of foo, which the catch + # would then try and eval out of the foo context, accessing + # compiled local indices + catch {unset args} + proc foo {args} { + foreach v $args { + upvar $v var + return "variable $v existence: [info exists var]" + } + } + foo a + list [catch [info body foo] msg] $msg +} {1 {can't read "args": no such variable}} # "info cmdcount" is no longer accurate for compiled commands! # The expected result for info-3.1 used to be "3" and is now "1" |