fix linting errors

This commit is contained in:
Sebastian McKenzie 2015-02-03 20:11:38 +11:00
parent b7680059c8
commit 8e708906a8

View File

@ -183,9 +183,9 @@ Scope.prototype.getInfo = function () {
var references = info.references = object(); var references = info.references = object();
var types = info.types = object(); var types = info.types = object();
var declarationKinds = info.declarationKinds = { var declarationKinds = info.declarationKinds = {
"const": object(),
"var": object(), "var": object(),
"let": object(), "let": object()
"const": object()
}; };
var add = function (node, reference) { var add = function (node, reference) {
@ -195,8 +195,14 @@ Scope.prototype.getInfo = function () {
if (!reference) { if (!reference) {
for (var key in ids) { for (var key in ids) {
var id = ids[key];
if (id.typeAnnotation) {
types[id] = id.typeAnnotation;
}
if (declarationKinds["let"][key] || declarationKinds["const"][key]) { if (declarationKinds["let"][key] || declarationKinds["const"][key]) {
throw self.file.errorWithNode(ids[key], "Duplicate declaration " + key, TypeError); throw self.file.errorWithNode(id, "Duplicate declaration " + key, TypeError);
} }
} }