diff options
Diffstat (limited to 'tools/eslint/lib/rules/block-scoped-var.js')
-rw-r--r-- | tools/eslint/lib/rules/block-scoped-var.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/eslint/lib/rules/block-scoped-var.js b/tools/eslint/lib/rules/block-scoped-var.js index 28755558f1..42d8422a00 100644 --- a/tools/eslint/lib/rules/block-scoped-var.js +++ b/tools/eslint/lib/rules/block-scoped-var.js @@ -37,6 +37,7 @@ module.exports = function(context) { */ function report(reference) { var identifier = reference.identifier; + context.report( identifier, "'{{name}}' used outside of binding context.", @@ -64,12 +65,15 @@ module.exports = function(context) { */ function isOutsideOfScope(reference) { var idRange = reference.identifier.range; + return idRange[0] < scopeRange[0] || idRange[1] > scopeRange[1]; } // Gets declared variables, and checks its references. var variables = context.getDeclaredVariables(node); + for (var i = 0; i < variables.length; ++i) { + // Reports. variables[i] .references |