add support for ClassDeclaration and FunctionDeclaration read-only checking - fixes #53
This commit is contained in:
@@ -55,7 +55,9 @@ exports.ForStatement = function (node) {
|
||||
traverse(node, function (child) {
|
||||
if (child._ignoreConstant) return;
|
||||
|
||||
if (child.type === "VariableDeclarator") {
|
||||
if (child.type === "VariableDeclarator" ||
|
||||
child.type === "FunctionDeclaration" ||
|
||||
child.type === "ClassDeclaration") {
|
||||
check(child, child.id.name);
|
||||
} else if (child.type === "AssignmentExpression") {
|
||||
check(child, child.left.name);
|
||||
|
||||
Reference in New Issue
Block a user