let removeChild() return the detached node (like the c++ version)
This commit is contained in:
parent
ff5743d3e7
commit
a4c23008f4
1 changed files with 3 additions and 2 deletions
|
@ -267,12 +267,13 @@ static naRef f_removeChild(naContext c, naRef me, int argc, naRef* args)
|
||||||
naRef child = naVec_get(argv, 0);
|
naRef child = naVec_get(argv, 0);
|
||||||
naRef index = naVec_get(argv, 1);
|
naRef index = naVec_get(argv, 1);
|
||||||
if(!naIsString(child) || !naIsNum(index)) return naNil();
|
if(!naIsString(child) || !naIsNum(index)) return naNil();
|
||||||
|
SGPropertyNode* n = 0;
|
||||||
try {
|
try {
|
||||||
(*node)->removeChild(naStr_data(child), (int)index.num, false);
|
n = (*node)->removeChild(naStr_data(child), (int)index.num, false);
|
||||||
} catch (const string& err) {
|
} catch (const string& err) {
|
||||||
naRuntimeError(c, (char *)err.c_str());
|
naRuntimeError(c, (char *)err.c_str());
|
||||||
}
|
}
|
||||||
return naNil();
|
return propNodeGhostCreate(c, n);
|
||||||
}
|
}
|
||||||
|
|
||||||
static naRef f_removeChildren(naContext c, naRef me, int argc, naRef* args)
|
static naRef f_removeChildren(naContext c, naRef me, int argc, naRef* args)
|
||||||
|
|
Loading…
Add table
Reference in a new issue