summaryrefslogtreecommitdiffstats
path: root/generic/tclExecute.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2012-11-02 18:13:20 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2012-11-02 18:13:20 (GMT)
commitce7c13b7962d2ebcd432dfb05fffe812c4d172d2 (patch)
tree51f3474d6aea4c638b7abdc0ee79609ab7fccd98 /generic/tclExecute.c
parenta7dc229d16889c9f6f66d197d4e0bf1afbec5578 (diff)
downloadtcl-ce7c13b7962d2ebcd432dfb05fffe812c4d172d2.zip
tcl-ce7c13b7962d2ebcd432dfb05fffe812c4d172d2.tar.gz
tcl-ce7c13b7962d2ebcd432dfb05fffe812c4d172d2.tar.bz2
Added more TclOO introspection bytecodes ([info object class], [info object namespace]). Also moved TclOO-in-8.6 to using the main Tcl internal ensemble builder.
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r--generic/tclExecute.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 1e24cb3..bf07dd7 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -4231,6 +4231,34 @@ TEBCresume(
TRACE_WITH_OBJ(("=> "), objResultPtr);
NEXT_INST_F(1, 0, 1);
}
+ {
+ Object *oPtr;
+
+ case INST_TCLOO_CLASS:
+ oPtr = (Object *) Tcl_GetObjectFromObj(interp, OBJ_AT_TOS);
+ if (oPtr == NULL) {
+ TRACE(("%.30s => ERROR: not object\n", O2S(OBJ_AT_TOS)));
+ goto gotError;
+ }
+ objResultPtr = TclOOObjectName(interp, oPtr->selfCls->thisPtr);
+ TRACE_WITH_OBJ(("%.30s => ", O2S(OBJ_AT_TOS)), objResultPtr);
+ NEXT_INST_F(1, 1, 1);
+ case INST_TCLOO_NS:
+ oPtr = (Object *) Tcl_GetObjectFromObj(interp, OBJ_AT_TOS);
+ if (oPtr == NULL) {
+ TRACE(("%.30s => ERROR: not object\n", O2S(OBJ_AT_TOS)));
+ goto gotError;
+ }
+
+ /*
+ * TclOO objects *never* have the global namespace as their NS.
+ */
+
+ TclNewStringObj(objResultPtr, oPtr->namespacePtr->fullName,
+ strlen(oPtr->namespacePtr->fullName));
+ TRACE_WITH_OBJ(("%.30s => ", O2S(OBJ_AT_TOS)), objResultPtr);
+ NEXT_INST_F(1, 1, 1);
+ }
/*
* -----------------------------------------------------------------