diff --git a/lib/rules/no-prototype-builtins.js b/lib/rules/no-prototype-builtins.js index 5bed2539a64..a00d3707204 100644 --- a/lib/rules/no-prototype-builtins.js +++ b/lib/rules/no-prototype-builtins.js @@ -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 }); diff --git a/tests/lib/rules/no-prototype-builtins.js b/tests/lib/rules/no-prototype-builtins.js index b1493e45561..e4f0fa30f78 100644 --- a/tests/lib/rules/no-prototype-builtins.js +++ b/tests/lib/rules/no-prototype-builtins.js @@ -41,6 +41,8 @@ const invalid = [ errors: [{ line: 1, column: 5, + endLine: 1, + endColumn: 19, messageId: "prototypeBuildIn", data: { prop: "hasOwnProperty" }, type: "CallExpression" @@ -51,6 +53,8 @@ const invalid = [ errors: [{ line: 1, column: 5, + endLine: 1, + endColumn: 18, messageId: "prototypeBuildIn", data: { prop: "isPrototypeOf" }, type: "CallExpression" @@ -61,6 +65,8 @@ const invalid = [ errors: [{ line: 1, column: 5, + endLine: 1, + endColumn: 25, messageId: "prototypeBuildIn", data: { prop: "propertyIsEnumerable" } }] @@ -70,6 +76,8 @@ const invalid = [ errors: [{ line: 1, column: 9, + endLine: 1, + endColumn: 23, messageId: "prototypeBuildIn", data: { prop: "hasOwnProperty" }, type: "CallExpression" @@ -80,6 +88,8 @@ const invalid = [ errors: [{ line: 1, column: 13, + endLine: 1, + endColumn: 26, messageId: "prototypeBuildIn", data: { prop: "isPrototypeOf" }, type: "CallExpression"