browser: return error for double end().

This commit is contained in:
Christopher Jeffrey 2016-08-27 15:58:50 -07:00
parent cf0e630e4e
commit eb6aec9888
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -144,6 +144,8 @@ Iterator.prototype.seek = function seek(key) {
};
Iterator.prototype.end = function end(callback) {
if (this._end)
return callback(new Error('end() already called on iterator.'));
this._end = true;
this.iter.end(callback);
};