diff --git a/test/parallel/test-assert.js b/test/parallel/test-assert.js index 46ce983f4ba3ca..d779051d7f1d35 100644 --- a/test/parallel/test-assert.js +++ b/test/parallel/test-assert.js @@ -73,9 +73,11 @@ assert.throws(makeBlock(a.deepEqual, /a/i, /a/)); assert.throws(makeBlock(a.deepEqual, /a/m, /a/)); assert.throws(makeBlock(a.deepEqual, /a/igm, /a/im)); -var re1 = /a/; -re1.lastIndex = 3; -assert.throws(makeBlock(a.deepEqual, re1, /a/)); +{ + const re1 = /a/; + re1.lastIndex = 3; + assert.throws(makeBlock(a.deepEqual, re1, /a/)); +} // 7.4 @@ -172,10 +174,11 @@ assert.throws(makeBlock(a.deepStrictEqual, /a/i, /a/)); assert.throws(makeBlock(a.deepStrictEqual, /a/m, /a/)); assert.throws(makeBlock(a.deepStrictEqual, /a/igm, /a/im)); -var re1 = /a/; -re1.lastIndex = 3; -assert.throws(makeBlock(a.deepStrictEqual, re1, /a/)); - +{ + const re1 = /a/; + re1.lastIndex = 3; + assert.throws(makeBlock(a.deepStrictEqual, re1, /a/)); +} // 7.4 - strict assert.throws(makeBlock(a.deepStrictEqual, 4, '4'),