summaryrefslogtreecommitdiffstats
path: root/tests/compile.test
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2002-04-15 17:32:18 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2002-04-15 17:32:18 (GMT)
commitc57b1b3f7c6afcd33faa0e7f8451d07435660464 (patch)
treefa25103bdb29439c30001f21efa3284d3ad7dd6b /tests/compile.test
parentce15514b339bfae56c6b2c81da04653c4dff772a (diff)
downloadtcl-c57b1b3f7c6afcd33faa0e7f8451d07435660464.zip
tcl-c57b1b3f7c6afcd33faa0e7f8451d07435660464.tar.gz
tcl-c57b1b3f7c6afcd33faa0e7f8451d07435660464.tar.bz2
made bytecodes check for a catch before returning; the compiled [return] is otherwise non-catchable. [Bug 542588]
Diffstat (limited to 'tests/compile.test')
-rw-r--r--tests/compile.test11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/compile.test b/tests/compile.test
index 7086de5..aef9ac0 100644
--- a/tests/compile.test
+++ b/tests/compile.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: compile.test,v 1.18 2002/03/15 15:39:07 dkf Exp $
+# RCS: @(#) $Id: compile.test,v 1.19 2002/04/15 17:32:18 msofer Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -98,6 +98,15 @@ test compile-3.3 {TclCompileCatchCmd: overagressive compiling [bug 219184]} {
catch {catch-test error} ::foo
set ::foo
} {GOOD}
+test compile-3.4 {TclCompileCatchCmd: bcc'ed [return] is caught} {
+ proc foo {} {
+ set fail [catch {
+ return 1
+ }] ; # {}
+ return 2
+ }
+ foo
+} {2}
test compile-4.1 {TclCompileForCmd: command substituted test expression} {
set i 0