This error occurs on node 0.6.19, not sure be fixed on 0.8 or not.
suppose I have a nest function like this:
<=======================================
function outer() {
var query = {};
query.startkey = [];
query.endkey = [];
query.startkey.push('report');
query.startkey.push({});
var keysCallback = function(result) {
query.startkey.push(result.key1);
query.startkey.push(result.key2);
......
}
getResultFunction(args, keysCallback);
}
======================================>
most time, it works well, but in some very very rare chance, I got the error like this:
<=======================================
Object ["report",{}] has no method 'push'
========================================>
if we inspect it, it'll tell that query.startkeys is an object with the array literal notation '["report",{}]', but not a real array.
Since it occurs inside the inner keysCallback, but query.startkey was defined explicitly in the outer function, and works well.
This make methink maybe there are some runtime errors, during the runtime lookup the query.startkeys from the scope of keysCallback to the outer function.
But I am not a expert on v8, so this is just a suspection. I'd like to hear your opinion about this.
--thanks
kuno