diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2018-05-15 13:04:10 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2018-05-15 13:04:10 (GMT) |
commit | 44d75f55ba0b0486342eb4d3e228b68dc6eef00d (patch) | |
tree | 2573310b16ebdfcea2159a4b30d2c0b07bea71e7 /generic/tclOOInfo.c | |
parent | e47337c5b00200e9f351be71fa18f2ce4182d146 (diff) | |
download | tcl-44d75f55ba0b0486342eb4d3e228b68dc6eef00d.zip tcl-44d75f55ba0b0486342eb4d3e228b68dc6eef00d.tar.gz tcl-44d75f55ba0b0486342eb4d3e228b68dc6eef00d.tar.bz2 |
Make [info object methods] and [info class methods] work right.
Diffstat (limited to 'generic/tclOOInfo.c')
-rw-r--r-- | generic/tclOOInfo.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/generic/tclOOInfo.c b/generic/tclOOInfo.c index db490fb..fe433e4 100644 --- a/generic/tclOOInfo.c +++ b/generic/tclOOInfo.c @@ -533,7 +533,8 @@ InfoObjectMethodsCmd( "private", "public", "unexported" }; enum Scopes { - SCOPE_PRIVATE, SCOPE_PUBLIC, SCOPE_UNEXPORTED + SCOPE_PRIVATE, SCOPE_PUBLIC, SCOPE_UNEXPORTED, + SCOPE_LOCALPRIVATE }; if (objc < 2) { @@ -587,6 +588,9 @@ InfoObjectMethodsCmd( case SCOPE_PUBLIC: flag = PUBLIC_METHOD; break; + case SCOPE_LOCALPRIVATE: + flag = PRIVATE_METHOD; + break; case SCOPE_UNEXPORTED: flag = 0; break; @@ -608,7 +612,7 @@ InfoObjectMethodsCmd( } } else if (oPtr->methodsPtr) { FOREACH_HASH(namePtr, mPtr, oPtr->methodsPtr) { - if (mPtr->typePtr != NULL && (mPtr->flags & flag) == flag) { + if (mPtr->typePtr && (mPtr->flags & SCOPE_FLAGS) == flag) { Tcl_ListObjAppendElement(NULL, resultObj, namePtr); } } @@ -1314,7 +1318,7 @@ InfoClassMethodsCmd( FOREACH_HASH_DECLS; FOREACH_HASH(namePtr, mPtr, &clsPtr->classMethods) { - if (mPtr->typePtr != NULL && (mPtr->flags & flag) == flag) { + if (mPtr->typePtr && (mPtr->flags & SCOPE_FLAGS) == flag) { Tcl_ListObjAppendElement(NULL, resultObj, namePtr); } } |