diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-10-14 18:40:54 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-10-14 18:40:54 +0200 |
commit | 9df98e65f842cf3acae09cbdd969966f42d64469 (patch) | |
tree | f071d3e09a342c208fb8e1cd3f5241d64fbfbaf3 /node_modules/tslint/lib/rules/preferConstRule.js | |
parent | 008926b18470e7f394cd640302957b29728a9803 (diff) |
update dependencies
Diffstat (limited to 'node_modules/tslint/lib/rules/preferConstRule.js')
-rw-r--r-- | node_modules/tslint/lib/rules/preferConstRule.js | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/node_modules/tslint/lib/rules/preferConstRule.js b/node_modules/tslint/lib/rules/preferConstRule.js index 1efc5b1e0..6bb1a3cd0 100644 --- a/node_modules/tslint/lib/rules/preferConstRule.js +++ b/node_modules/tslint/lib/rules/preferConstRule.js @@ -22,7 +22,7 @@ var Lint = require("../index"); var utils = require("tsutils"); var OPTION_DESTRUCTURING_ALL = "all"; var OPTION_DESTRUCTURING_ANY = "any"; -var Rule = (function (_super) { +var Rule = /** @class */ (function (_super) { tslib_1.__extends(Rule, _super); function Rule() { return _super !== null && _super.apply(this, arguments) || this; @@ -64,7 +64,7 @@ var Rule = (function (_super) { return Rule; }(Lint.Rules.AbstractRule)); exports.Rule = Rule; -var Scope = (function () { +var Scope = /** @class */ (function () { function Scope(functionScope) { this.variables = new Map(); this.reassigned = new Set(); @@ -83,7 +83,7 @@ var Scope = (function () { }; return Scope; }()); -var PreferConstWalker = (function (_super) { +var PreferConstWalker = /** @class */ (function (_super) { tslib_1.__extends(PreferConstWalker, _super); function PreferConstWalker() { return _super !== null && _super.apply(this, arguments) || this; @@ -137,10 +137,12 @@ var PreferConstWalker = (function (_super) { _this.handleVariableDeclaration(node); } else if (node.kind === ts.SyntaxKind.CatchClause) { - _this.handleBindingName(node.variableDeclaration.name, { - canBeConst: false, - isBlockScoped: true, - }); + if (node.variableDeclaration !== undefined) { + _this.handleBindingName(node.variableDeclaration.name, { + canBeConst: false, + isBlockScoped: true, + }); + } } else if (node.kind === ts.SyntaxKind.Parameter) { _this.handleBindingName(node.name, { |