diff options
Diffstat (limited to 'tools/eslint/lib/rules/no-sequences.js')
-rw-r--r-- | tools/eslint/lib/rules/no-sequences.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/eslint/lib/rules/no-sequences.js b/tools/eslint/lib/rules/no-sequences.js index 9f7bfe3e7d..538e36a12f 100644 --- a/tools/eslint/lib/rules/no-sequences.js +++ b/tools/eslint/lib/rules/no-sequences.js @@ -34,7 +34,7 @@ module.exports = function(context) { * @returns {boolean} True if parens around node belong to parent node. */ function requiresExtraParens(node) { - return node.parent && parenthesized[node.parent.type] != null && + return node.parent && parenthesized[node.parent.type] && node === node.parent[parenthesized[node.parent.type]]; } @@ -85,7 +85,8 @@ module.exports = function(context) { } } - context.report(node, "Unexpected use of comma operator."); + var child = context.getTokenAfter(node.expressions[0]); + context.report(node, child.loc.start, "Unexpected use of comma operator."); } }; |