fix: add "no-prototype-builtins" eslint-rule and fix all occurences

This commit is contained in:
Nils Knappmeier
2019-11-18 04:14:54 +01:00
committed by Nils Knappmeier
parent 1988878087
commit f7f05d7558
8 changed files with 28 additions and 32 deletions
+1 -1
View File
@@ -59,7 +59,7 @@ describe('compiler', function() {
Handlebars.compile(' \n {{#if}}\n{{/def}}')();
equal(true, false, 'Statement must throw exception. This line should not be executed.');
} catch (err) {
equal(err.propertyIsEnumerable('column'), true, 'Checking error column');
equal(Object.prototype.propertyIsEnumerable.call(err, 'column'), true, 'Checking error column');
}
});
+2 -2
View File
@@ -211,12 +211,12 @@ describe('Regressions', function() {
// It's valid to execute a block against an undefined context, but
// helpers can not do so, so we expect to have an empty object here;
for (var name in this) {
if (this.hasOwnProperty(name)) {
if (Object.prototype.hasOwnProperty.call(this, name)) {
return 'found';
}
}
// And to make IE happy, check for the known string as length is not enumerated.
return (this == 'bat' ? 'found' : 'not');
return (this === 'bat' ? 'found' : 'not');
}
};