browser: return error for double end().
This commit is contained in:
parent
cf0e630e4e
commit
eb6aec9888
@ -144,6 +144,8 @@ Iterator.prototype.seek = function seek(key) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
Iterator.prototype.end = function end(callback) {
|
Iterator.prototype.end = function end(callback) {
|
||||||
|
if (this._end)
|
||||||
|
return callback(new Error('end() already called on iterator.'));
|
||||||
this._end = true;
|
this._end = true;
|
||||||
this.iter.end(callback);
|
this.iter.end(callback);
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user