diff --git a/lib/compiler/index.js b/lib/compiler/index.js index c1f383a..432110b 100644 --- a/lib/compiler/index.js +++ b/lib/compiler/index.js @@ -8,7 +8,7 @@ function processOptions(options, defaults) { }); Object.keys(defaults).forEach(name => { - if (!processedOptions.hasOwnProperty(name)) { + if (!Object.prototype.hasOwnProperty.call(processedOptions, name)) { processedOptions[name] = defaults[name]; } }); diff --git a/lib/compiler/passes/report-duplicate-labels.js b/lib/compiler/passes/report-duplicate-labels.js index 1c83e56..7e15be6 100644 --- a/lib/compiler/passes/report-duplicate-labels.js +++ b/lib/compiler/passes/report-duplicate-labels.js @@ -33,7 +33,7 @@ function reportDuplicateLabels(ast) { action: checkExpressionWithClonedEnv, labeled(node, env) { - if (env.hasOwnProperty(node.label)) { + if (Object.prototype.hasOwnProperty.call(env, node.label)) { throw new GrammarError( "Label \"" + node.label + "\" is already defined " + "at line " + env[node.label].start.line + ", " diff --git a/lib/compiler/passes/report-duplicate-rules.js b/lib/compiler/passes/report-duplicate-rules.js index 72c3e9b..ba318bb 100644 --- a/lib/compiler/passes/report-duplicate-rules.js +++ b/lib/compiler/passes/report-duplicate-rules.js @@ -9,7 +9,7 @@ function reportDuplicateRules(ast) { let check = visitor.build({ rule(node) { - if (rules.hasOwnProperty(node.name)) { + if (Object.prototype.hasOwnProperty.call(rules, node.name)) { throw new GrammarError( "Rule \"" + node.name + "\" is already defined " + "at line " + rules[node.name].start.line + ", " diff --git a/lib/compiler/visitor.js b/lib/compiler/visitor.js index 54446e6..9bb9532 100644 --- a/lib/compiler/visitor.js +++ b/lib/compiler/visitor.js @@ -61,7 +61,7 @@ let visitor = { }; Object.keys(DEFAULT_FUNCTIONS).forEach(type => { - if (!functions.hasOwnProperty(type)) { + if (!Object.prototype.hasOwnProperty.call(functions, type)) { functions[type] = DEFAULT_FUNCTIONS[type]; } });