ldb: error on missing features.

This commit is contained in:
Christopher Jeffrey 2016-09-10 23:56:18 -07:00
parent f3a4a0fb30
commit 91324b2531
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -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);
};