1
0
Fork 0

let removeChild() return the detached node (like the c++ version)

This commit is contained in:
mfranz 2008-07-24 11:25:13 +00:00
parent ff5743d3e7
commit a4c23008f4

View file

@ -267,12 +267,13 @@ static naRef f_removeChild(naContext c, naRef me, int argc, naRef* args)
naRef child = naVec_get(argv, 0);
naRef index = naVec_get(argv, 1);
if(!naIsString(child) || !naIsNum(index)) return naNil();
SGPropertyNode* n = 0;
try {
(*node)->removeChild(naStr_data(child), (int)index.num, false);
n = (*node)->removeChild(naStr_data(child), (int)index.num, false);
} catch (const string& err) {
naRuntimeError(c, (char *)err.c_str());
}
return naNil();
return propNodeGhostCreate(c, n);
}
static naRef f_removeChildren(naContext c, naRef me, int argc, naRef* args)