summaryrefslogtreecommitdiffstats
path: root/generic/tclOOScript.h
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2018-06-28 08:12:07 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2018-06-28 08:12:07 (GMT)
commit8219fb26323aa59d5e46299099e965049a0cb654 (patch)
treec63c987d34f5450b58b1f5e30b0fa2b424798de1 /generic/tclOOScript.h
parent082e8c6d7aa61e4250a321d2d44ca57c8d09049d (diff)
downloadtcl-8219fb26323aa59d5e46299099e965049a0cb654.zip
tcl-8219fb26323aa59d5e46299099e965049a0cb654.tar.gz
tcl-8219fb26323aa59d5e46299099e965049a0cb654.tar.bz2
Tests for abstract and singleton
Diffstat (limited to 'generic/tclOOScript.h')
-rw-r--r--generic/tclOOScript.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/generic/tclOOScript.h b/generic/tclOOScript.h
index 73c3383..22f5e56 100644
--- a/generic/tclOOScript.h
+++ b/generic/tclOOScript.h
@@ -143,8 +143,9 @@ static const char *tclOOSetupScript =
" variable object\n"
" unexport create createWithNamespace\n"
" method new args {\n"
-" if {![info exists object]} {\n"
+" if {![info exists object] || ![info object isa object $object]} {\n"
" set object [next {*}$args]\n"
+" ::oo::objdefine $object unexport destroy\n"
" }\n"
" return $object\n"
" }\n"