Merge pull request #2611 from IvarK/fix-no-prototype-builtins

This commit is contained in:
Waiting Idly 2022-05-21 07:00:03 -07:00 committed by GitHub
commit 4a046ee3c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 5 deletions

View File

@ -97,7 +97,7 @@ const ReactivityComplainer = {
throw new Error(`Boi you fukked up - ${path} became REACTIVE (oh shite)`);
}
for (const key in obj) {
if (!obj.hasOwnProperty(key)) continue;
if (!Object.prototype.hasOwnProperty.call(obj, key)) continue;
const prop = obj[key];
if (typeof prop === "object") {
this.checkReactivity(prop, `${path}.${key}`);

View File

@ -166,7 +166,7 @@ dev.resetDilation = function() {
// when making a special glyph, so no max-params
// eslint-disable-next-line max-params
dev.giveSpecialGlyph = function(color, symbol, level, rawLevel = level) {
if (!specialGlyphSymbols.hasOwnProperty(symbol)) return;
if (!Object.prototype.hasOwnProperty.call(specialGlyphSymbols, symbol)) return;
if (Glyphs.freeInventorySpace === 0) return;
const glyph = GlyphGenerator.randomGlyph({ actualLevel: level, rawLevel });
glyph.symbol = symbol;

View File

@ -30,7 +30,10 @@ export const GameIntervals = (function() {
// Not a getter because getter will cause stack overflow
all() {
return Object.values(GameIntervals)
.filter(i => i.hasOwnProperty("start") && i.hasOwnProperty("stop"));
.filter(i =>
Object.prototype.hasOwnProperty.call(i, "start") &&
Object.prototype.hasOwnProperty.call(i, "stop")
);
},
start() {
// eslint-disable-next-line no-shadow

View File

@ -49,7 +49,7 @@ export const PerformanceStats = {
function render(rootBlock) {
indentLevel++;
for (const blockName in rootBlock) {
if (!rootBlock.hasOwnProperty(blockName)) continue;
if (!Object.prototype.hasOwnProperty.call(rootBlock, blockName)) continue;
const block = rootBlock[blockName];
const records = block.records;
while (records.length > 1 && records.last().timestamp - records.first().timestamp > samplePeriod) {

View File

@ -984,7 +984,7 @@ export function guardFromNaNValues(obj) {
}
for (const key in obj) {
if (!obj.hasOwnProperty(key)) continue;
if (!Object.prototype.hasOwnProperty.call(obj, key)) continue;
// TODO: rework autobuyer saving
if (key === "automator") continue;