summaryrefslogtreecommitdiffstats
path: root/tests/oo.test
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2016-07-09 15:47:28 (GMT)
committerdgp <dgp@users.sourceforge.net>2016-07-09 15:47:28 (GMT)
commitda4f0a3cc9ce8134a629c12ce02572e0ee69bb3b (patch)
tree6ca06be4a2c871912e4d135a868e6ec1a96e9081 /tests/oo.test
parent7332635af1609ad38fa7021022dd79996b75144c (diff)
parent39488ce3ef11fcbac48bd3c7e35b3ba3fb80c2de (diff)
downloadtcl-da4f0a3cc9ce8134a629c12ce02572e0ee69bb3b.zip
tcl-da4f0a3cc9ce8134a629c12ce02572e0ee69bb3b.tar.gz
tcl-da4f0a3cc9ce8134a629c12ce02572e0ee69bb3b.tar.bz2
merge 8.6
Diffstat (limited to 'tests/oo.test')
-rw-r--r--tests/oo.test32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/oo.test b/tests/oo.test
index 62f123c..ccb05c1 100644
--- a/tests/oo.test
+++ b/tests/oo.test
@@ -3424,6 +3424,38 @@ test oo-27.22 {variables declaration uniqueifies: Bug 3396896} -setup {
} -cleanup {
foo destroy
} -result {v t}
+test oo-27.23 {variable resolver leakage: Bug 1493a43044} -setup {
+ oo::class create Super
+ oo::class create Master {
+ superclass Super
+ variable member1 member2
+ constructor {} {
+ set member1 master1
+ set member2 master2
+ }
+ method getChild {} {
+ Child new [self]
+ }
+ }
+ oo::class create Child {
+ superclass Super
+ variable member1 result
+ constructor {m} {
+ set [namespace current]::member1 child1
+ set ns [info object namespace $m]
+ namespace upvar $ns member1 l1 member2 l2
+ upvar 1 member1 l3 member2 l4
+ [format namespace] upvar $ns member1 l5 member2 l6
+ [format upvar] 1 member1 l7 member2 l8
+ set result [list $l1 $l2 $l3 $l4 $l5 $l6 $l7 $l8]
+ }
+ method result {} {return $result}
+ }
+} -body {
+ [[Master new] getChild] result
+} -cleanup {
+ Super destroy
+} -result {master1 master2 master1 master2 master1 master2 master1 master2}
# A feature that's not supported because the mechanism may change without
# warning, but is supposed to work...