Skip to content

Commit

Permalink
Fix indentation in the test from jashkenas#2912
Browse files Browse the repository at this point in the history
  • Loading branch information
jgonggrijp committed Mar 13, 2021
1 parent 798eafa commit a6159ff
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions test/utility.js
Expand Up @@ -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');
});

}());

0 comments on commit a6159ff

Please sign in to comment.