From a6159ffa917f102e8f0c93609cb32e913be96834 Mon Sep 17 00:00:00 2001 From: Julian Gonggrijp Date: Sat, 13 Mar 2021 21:58:07 +0100 Subject: [PATCH] Fix indentation in the test from #2912 --- test/utility.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/test/utility.js b/test/utility.js index ec16afda6..750c56597 100644 --- a/test/utility.js +++ b/test/utility.js @@ -466,18 +466,18 @@ }); QUnit.test('#2911 - _.template must not trigger CVE-2021-23337.', function(assert) { - QUnit.holyProperty = 'holy'; - var invalidVariableNames = [ - '){delete QUnit.holyProperty}; with(obj', - '(x = QUnit.holyProperty = "evil"), obj', - 'document.write("got you!")' - ]; - _.each(invalidVariableNames, function(name) { - assert.throws(function() { _.template('', { variable: name })(); }); - }); - var holy = QUnit.holyProperty; - delete QUnit.holyProperty; - assert.strictEqual(holy, 'holy'); + QUnit.holyProperty = 'holy'; + var invalidVariableNames = [ + '){delete QUnit.holyProperty}; with(obj', + '(x = QUnit.holyProperty = "evil"), obj', + 'document.write("got you!")' + ]; + _.each(invalidVariableNames, function(name) { + assert.throws(function() { _.template('', { variable: name })(); }); + }); + var holy = QUnit.holyProperty; + delete QUnit.holyProperty; + assert.strictEqual(holy, 'holy'); }); }());