summaryrefslogtreecommitdiffstats
path: root/library/msgcat
diff options
context:
space:
mode:
authoroehhar <harald.oehlmann@elmicron.de>2018-01-12 14:13:03 (GMT)
committeroehhar <harald.oehlmann@elmicron.de>2018-01-12 14:13:03 (GMT)
commit2cfe8bb5619eb9a1de655bda6a208e9e2fb8b81b (patch)
treed2ba4e5e5fbaee23838b70ed4f029ea9ab5c7f72 /library/msgcat
parente9f2695255b873c200a7fc465f860b4fd5c97a02 (diff)
downloadtcl-2cfe8bb5619eb9a1de655bda6a208e9e2fb8b81b.zip
tcl-2cfe8bb5619eb9a1de655bda6a208e9e2fb8b81b.tar.gz
tcl-2cfe8bb5619eb9a1de655bda6a208e9e2fb8b81b.tar.bz2
Use the test "[namespace which self] ne "::oo::Helpers::self"" to check if we are within an object (undocumented test proposed by dkf on clt 2018-01-12
Diffstat (limited to 'library/msgcat')
-rw-r--r--library/msgcat/msgcat.tcl5
1 files changed, 4 insertions, 1 deletions
diff --git a/library/msgcat/msgcat.tcl b/library/msgcat/msgcat.tcl
index 885240f..66cedea 100644
--- a/library/msgcat/msgcat.tcl
+++ b/library/msgcat/msgcat.tcl
@@ -1119,7 +1119,10 @@ proc msgcat::ConvertLocale {value} {
proc ::msgcat::PackageNamespaceGet {} {
uplevel 2 {
# Check for no object
- if {0 == [llength [info commands self]]} {return [namespace current]}
+ # (undocumented test proposed by dkf 2018-01-12)
+ if { [namespace which self] ne "::oo::Helpers::self"} {
+ return [namespace current]
+ }
set Class [info object class [self]]
# Check for classless defined object
if {$Class eq {::oo::object}} {