From: mfranz Date: Mon, 7 May 2007 14:23:56 +0000 (+0000) Subject: let foo.getAttribute("listeners") return the number of listeners attached X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ef3fb93056f2db62def966a926b81fd45eea8551;p=flightgear.git let foo.getAttribute("listeners") return the number of listeners attached to props.Node foo (shall be used in debug.nas and possibly props.nas) --- diff --git a/src/Scripting/nasal-props.cxx b/src/Scripting/nasal-props.cxx index 77c74a830..87afb1d93 100644 --- a/src/Scripting/nasal-props.cxx +++ b/src/Scripting/nasal-props.cxx @@ -83,6 +83,7 @@ static naRef f_getAttribute(naContext c, naRef me, int argc, naRef* args) SGPropertyNode::Attribute attr; if(!a) a = ""; if(!strcmp(a, "children")) return naNum((*node)->nChildren()); + else if(!strcmp(a, "listeners")) return naNum((*node)->nListeners()); else if(!strcmp(a, "tied")) return naNum((*node)->isTied()); else if(!strcmp(a, "alias")) return naNum((*node)->isAlias()); else if(!strcmp(a, "read")) attr = SGPropertyNode::READ;