Index: TODO =================================================================== diff -u -r21686b86d06844eca86086b9f9391d77d54dbc06 -r3b5f62d43eeca24c06993127a7637e7b9ec17216 --- TODO (.../TODO) (revision 21686b86d06844eca86086b9f9391d77d54dbc06) +++ TODO (.../TODO) (revision 3b5f62d43eeca24c06993127a7637e7b9ec17216) @@ -5806,6 +5806,7 @@ testing/understanding behavior etc., such a command is helpful). - extend regression test +- make effects of namespace-imported classes more local ======================================================================== TODO: Index: generic/nsf.c =================================================================== diff -u -r0311e86856d1a716d494dc371bd4000c7945c51d -r3b5f62d43eeca24c06993127a7637e7b9ec17216 --- generic/nsf.c (.../nsf.c) (revision 0311e86856d1a716d494dc371bd4000c7945c51d) +++ generic/nsf.c (.../nsf.c) (revision 3b5f62d43eeca24c06993127a7637e7b9ec17216) @@ -1843,31 +1843,34 @@ if (cmd != NULL) { cls = NsfGetClassFromCmdPtr(cmd); -#if 1 if (cls == NULL) { /* * We have a cmd, but no class; namespace-imported classes are already * resolved, but we have to care, if a class is "imported" via "interp * alias". */ Tcl_Interp *alias_interp; - const char *alias_cmd_name; - Tcl_Obj *nameObj = objPtr; - Tcl_Obj **alias_ov; - int alias_oc = 0; + const char *alias_cmd_name, *qualifiedObjName; + Tcl_Obj *nameObj = objPtr; + Tcl_Obj **alias_ov; + int alias_oc = 0; if (!isAbsolutePath(objName)) { nameObj = NameInNamespaceObj(objName, CallingNameSpace(interp)); - objName = ObjStr(nameObj); + qualifiedObjName = ObjStr(nameObj); INCR_REF_COUNT(nameObj); + } else { + qualifiedObjName = objName; } - result = Tcl_GetAliasObj(interp, objName, + result = Tcl_GetAliasObj(interp, qualifiedObjName, &alias_interp, &alias_cmd_name, &alias_oc, &alias_ov); Tcl_ResetResult(interp); - /* we only want interp-aliases with 0 args */ - if (likely(result == TCL_OK) && alias_oc == 0) { + /* + * We only want interp-aliases with 0 args + */ + if (likely(result == TCL_OK) && likely(alias_oc == 0)) { cmd = NSFindCommand(interp, alias_cmd_name); /*fprintf(stderr, "..... alias arg 0 '%s' cmd %p\n", alias_cmd_name, cmd);*/ if (cmd != NULL) { @@ -1878,11 +1881,9 @@ /*fprintf(stderr, "..... final cmd %p, cls %p\n", cmd , cls);*/ if (nameObj != objPtr) { DECR_REF_COUNT(nameObj); - /* Make objName pointing to an intact value beyond this point */ - objName = ObjStr(objPtr); } } -#endif + if (likely(cls != NULL)) { *clPtr = cls; return TCL_OK;