pick only current constant violation if it's of the same scope

This commit is contained in:
Sebastian McKenzie 2015-06-13 02:19:57 +01:00
parent f5b921cda9
commit 43583e4e9d

View File

@ -56,6 +56,11 @@ function getTypeAnnotationBindingConstantViolations(path, name) {
visitedScopes.push(violationScope);
constantViolations.push(violation);
if (violationScope === path.scope) {
constantViolations = [violation];
break;
}
}
// add back on function constant violations since we can't track calls