ldb: error on missing features.
This commit is contained in:
parent
f3a4a0fb30
commit
91324b2531
@ -85,7 +85,7 @@ LowlevelUp.prototype.destroy = function destroy(callback) {
|
||||
assert(!this.loaded);
|
||||
|
||||
if (!this.backend.destroy)
|
||||
return utils.nextTick(callback);
|
||||
return utils.asyncify(callback)(new Error('Cannot destroy.'));
|
||||
|
||||
this.backend.destroy(this.location, callback);
|
||||
};
|
||||
@ -225,6 +225,10 @@ LowlevelUp.prototype.getProperty = function getProperty(name) {
|
||||
|
||||
LowlevelUp.prototype.approximateSize = function approximateSize(start, end, callback) {
|
||||
assert(this.loaded, 'Cannot use database before it is loaded.');
|
||||
|
||||
if (!this.binding.approximateSize)
|
||||
return utils.asyncify(callback)(new Error('Cannot get size.'));
|
||||
|
||||
this.binding.approximateSize(start, end, callback);
|
||||
};
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user