fix linting errors

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

View File

@ -179,13 +179,13 @@ Scope.prototype.getInfo = function () {
var info = block._scopeInfo = {}; var info = block._scopeInfo = {};
var bindings = info.bindings = object(); var bindings = info.bindings = object();
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 = {
"var": object(), "const": object(),
"let": object(), "var": object(),
"const": object() "let": 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);
} }
} }