Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix: add end location to report in no-prototype-builtins (refs #12334) (
  • Loading branch information
mdjermanovic committed Mar 26, 2020
1 parent 3e4e7f8 commit 8d50a7d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rules/no-prototype-builtins.js
Expand Up @@ -47,7 +47,7 @@ module.exports = {
if (DISALLOWED_PROPS.indexOf(propName) > -1) {
context.report({
messageId: "prototypeBuildIn",
loc: node.callee.property.loc.start,
loc: node.callee.property.loc,
data: { prop: propName },
node
});
Expand Down
10 changes: 10 additions & 0 deletions tests/lib/rules/no-prototype-builtins.js
Expand Up @@ -41,6 +41,8 @@ const invalid = [
errors: [{
line: 1,
column: 5,
endLine: 1,
endColumn: 19,
messageId: "prototypeBuildIn",
data: { prop: "hasOwnProperty" },
type: "CallExpression"
Expand All @@ -51,6 +53,8 @@ const invalid = [
errors: [{
line: 1,
column: 5,
endLine: 1,
endColumn: 18,
messageId: "prototypeBuildIn",
data: { prop: "isPrototypeOf" },
type: "CallExpression"
Expand All @@ -61,6 +65,8 @@ const invalid = [
errors: [{
line: 1,
column: 5,
endLine: 1,
endColumn: 25,
messageId: "prototypeBuildIn",
data: { prop: "propertyIsEnumerable" }
}]
Expand All @@ -70,6 +76,8 @@ const invalid = [
errors: [{
line: 1,
column: 9,
endLine: 1,
endColumn: 23,
messageId: "prototypeBuildIn",
data: { prop: "hasOwnProperty" },
type: "CallExpression"
Expand All @@ -80,6 +88,8 @@ const invalid = [
errors: [{
line: 1,
column: 13,
endLine: 1,
endColumn: 26,
messageId: "prototypeBuildIn",
data: { prop: "isPrototypeOf" },
type: "CallExpression"
Expand Down

0 comments on commit 8d50a7d

Please sign in to comment.