aboutsummaryrefslogtreecommitdiff
path: root/node_modules/tslint/lib/rules/preferConstRule.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/tslint/lib/rules/preferConstRule.js')
-rw-r--r--node_modules/tslint/lib/rules/preferConstRule.js16
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, {