-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Hi @robtweed
During fixing memory db that I use for tests I found an interesting scenario that breaks forEachChild. The execution never stops for me.
It relates with the following functionality:
https://github.com/robtweed/ewd-document-store/blob/master/lib/proto/forEach.js#L78
The test case:
var documentStore = new DocumentStore(db); // db - GTM
var documentNode = new documentStore.DocumentNode('temp');
documentNode.delete();
var foo = {
a: 'this is a',
b: 'this is b',
Barton: 'J',
Briggs: 'A',
Davies: 'D',
Davis: 'T',
Douglas: 'N',
c: ['a', 's', 'd'],
d: {
a: 'a',
b: 'b'
}
};
documentNode.$('foo').setDocument(foo);
documentNode.$('foo').forEachChild({
range: {
to: '123'
}
}, function (nodeName, node) {
// do somethng
});Even if the test case is not correct, I think we need to handle this behaviour. Another question, could you please provide me with example of correct test case for https://github.com/robtweed/ewd-document-store/blob/master/lib/proto/forEach.js#L78 I guess it should work with arrays only
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels