diff options
author | Steve Bennett <steveb@workware.net.au> | 2013-12-09 07:28:30 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2013-12-09 08:20:05 +1000 |
commit | dd213d13411bce204850d48669632bc57b242c7c (patch) | |
tree | 8dc14dafde01afe73ca826dff438d40254c927d8 /tests | |
parent | 2448a2047e587cae8a1b2f401607b7b4c3108429 (diff) | |
download | jimtcl-dd213d13411bce204850d48669632bc57b242c7c.zip jimtcl-dd213d13411bce204850d48669632bc57b242c7c.tar.gz jimtcl-dd213d13411bce204850d48669632bc57b242c7c.tar.bz2 |
Fix aio close from non-global namespace
aio [open], as well as similar commands return the name of the
created command. If this is done in the non-global namespace, the
returned name is implicitly scoped to the current namespace while
the actual command is created in the global namespace. Thus [close]
does not work when invoked in that namespace.
The solution is to return a fully qualified name, such as ::aio.handle3
Note that this may also be a problem for similar command such as
[proc] and [alias] that return command names.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/jim.test | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/jim.test b/tests/jim.test index e8c125e..c1ab8e7 100644 --- a/tests/jim.test +++ b/tests/jim.test @@ -3486,5 +3486,16 @@ test regression-1.1 {lrange bug with negative indexes of type int} { lrange {a b c} 0 [- 0 1] } {} +test regression-1.2 {open/close from non-global namespace} { + proc a::b {} { + set f [open $::argv0] + $f close + return $f + } + set f [a::b] + rename a::b "" + expr {$f in [info channels]} +} {0} + testreport |