add uid scope kind

This commit is contained in:
Sebastian McKenzie
2015-02-09 21:28:51 +11:00
parent 8a4296a948
commit ba0dfac53d
2 changed files with 4 additions and 3 deletions

View File

@@ -460,7 +460,7 @@ File.prototype.generateUid = function (name, scope) {
File.prototype.generateUidIdentifier = function (name, scope) {
scope = scope || this.scope;
var id = t.identifier(this.generateUid(name, scope));
scope.addBindingToFunctionScope(id);
scope.addBindingToFunctionScope(id, "uid");
return id;
};

View File

@@ -246,7 +246,7 @@ var programReferenceVisitor = {
enter: function (node, parent, scope, state) {
if (t.isReferencedIdentifier(node, parent) && !scope.hasReference(node.name)) {
state.register(node, true);
} else if (t.isLabelStatemented(node)) {
} else if (t.isLabeledStatement(node)) {
state.register(node.label, true);
}
}
@@ -283,7 +283,8 @@ Scope.prototype.crawl = function () {
"const": object(),
param: object(),
"var": object(),
"let": object()
"let": object(),
uid: object()
},
references: object(),