1
0
Fork 0

add resolveAlias() to props.nas

This commit is contained in:
Henning Stahlke 2019-02-12 18:35:10 +01:00
parent 9d353a3266
commit 74b0ef63c2

View file

@ -56,6 +56,22 @@ var Node = {
if((var p = me.getParent()) == nil) return nil;
p.removeChild(me.getName(), me.getIndex());
},
# follow alias links to "real" node (e.g. where the data is stored)
# optional argument: property node or prop path to resolve
# if no argument is given, operate on current obj ("me")
resolveAlias : func(p = nil) {
if (p == nil)
p = me;
elsif (typeof(p) == "scalar")
p = globals.getNode(p);
if (isa(p, Node)) {
while (p.getAttribute("alias")) {
p = p.getAliasTarget();
}
}
return p;
},
};
##