mirror of
https://github.com/status-im/realm-js.git
synced 2025-01-11 06:46:03 +00:00
Merge pull request #989 from realm/fix-deleteAll-event
report undefined deletions on deleteAll instead of max int count indexes
This commit is contained in:
commit
58a25dd453
@ -48,8 +48,14 @@ typename T::Value CollectionClass<T>::create_collection_change_set(ContextType c
|
||||
{
|
||||
ObjectType object = Object::create_empty(ctx);
|
||||
std::vector<ValueType> deletions, insertions, modifications;
|
||||
for (auto index : change_set.deletions.as_indexes()) {
|
||||
deletions.push_back(Value::from_number(ctx, index));
|
||||
|
||||
if (change_set.deletions.count() == std::numeric_limits<size_t>::max()) {
|
||||
deletions.push_back(Value::from_null(ctx));
|
||||
}
|
||||
else {
|
||||
for (auto index : change_set.deletions.as_indexes()) {
|
||||
deletions.push_back(Value::from_number(ctx, index));
|
||||
}
|
||||
}
|
||||
Object::set_property(ctx, object, "deletions", Object::create_array(ctx, deletions));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user