From 98ef6dfae9bd0e1999214ef52f3add1a63e013e2 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Tue, 17 Aug 2021 15:20:30 -0700 Subject: [PATCH] throw must create a new object --- src/locker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);