diff --git a/src/locker.js b/src/locker.js index a2e84b677..ff71238df 100644 --- a/src/locker.js +++ b/src/locker.js @@ -55,7 +55,7 @@ Locker.prototype.recursiveLock = function (operation) { Locker.prototype.unlock = function (operation) { assert.strictEqual(typeof operation, 'string'); - if (this._operation !== operation) throw BoxError(BoxError.BAD_STATE, 'Mismatched unlock. Current lock is for ' + this._operation); // throw because this is a programming error + if (this._operation !== operation) throw new BoxError(BoxError.BAD_STATE, 'Mismatched unlock. Current lock is for ' + this._operation); // throw because this is a programming error if (--this._lockDepth === 0) { debug('Released : %s', this._operation);