Add TODO
This commit is contained in:
parent
9549bab517
commit
a51ece60ac
|
@ -46,6 +46,7 @@ ArrayId CreateArray(int len, uint32_t flags)
|
||||||
|
|
||||||
if (len < 0) {
|
if (len < 0) {
|
||||||
flags |= SFALL_ARRAYFLAG_ASSOC;
|
flags |= SFALL_ARRAYFLAG_ASSOC;
|
||||||
|
// TODO: Implement
|
||||||
throw(std::invalid_argument("Not implemented yet"));
|
throw(std::invalid_argument("Not implemented yet"));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -87,7 +88,7 @@ ProgramValue GetArrayKey(ArrayId array_id, int index)
|
||||||
if (index == -1) { // special index to indicate if array is associative
|
if (index == -1) { // special index to indicate if array is associative
|
||||||
throw(std::invalid_argument("Not implemented yet"));
|
throw(std::invalid_argument("Not implemented yet"));
|
||||||
};
|
};
|
||||||
// TODO: if assoc
|
// TODO: assoc
|
||||||
return SFallScriptValue(index);
|
return SFallScriptValue(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,6 +98,9 @@ int LenArray(ArrayId array_id)
|
||||||
if (arr == nullptr) {
|
if (arr == nullptr) {
|
||||||
return -1;
|
return -1;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// TODO: assoc
|
||||||
|
|
||||||
return arr->size();
|
return arr->size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -125,6 +129,8 @@ void SetArray(ArrayId array_id, const SFallScriptValue& key, const SFallScriptVa
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// TODO: assoc
|
||||||
|
|
||||||
if (key.isInt()) {
|
if (key.isInt()) {
|
||||||
auto index = key.asInt();
|
auto index = key.asInt();
|
||||||
if (index >= 0 && index < arr->size()) {
|
if (index >= 0 && index < arr->size()) {
|
||||||
|
|
Loading…
Reference in New Issue