put function params into the param kind
This commit is contained in:
parent
c4e56894d9
commit
478f9e028f
@ -195,7 +195,9 @@ Scope.prototype.register = function (node, reference, kind) {
|
||||
for (var key in ids) {
|
||||
var id = ids[key];
|
||||
|
||||
if (kind !== "hoisted") this.checkBlockScopedCollisions(key, id);
|
||||
if (kind !== "hoisted" && kind !== "param") {
|
||||
this.checkBlockScopedCollisions(key, id);
|
||||
}
|
||||
|
||||
this.registerType(key, id, node);
|
||||
this.bindings[key] = id;
|
||||
@ -274,10 +276,11 @@ Scope.prototype.crawl = function () {
|
||||
|
||||
info = block._scopeInfo = {
|
||||
bindingKinds: {
|
||||
"hoisted": object(),
|
||||
"const": object(),
|
||||
"var": object(),
|
||||
"let": object()
|
||||
hoisted: object(),
|
||||
"const": object(),
|
||||
param: object(),
|
||||
"var": object(),
|
||||
"let": object()
|
||||
},
|
||||
|
||||
references: object(),
|
||||
@ -321,7 +324,7 @@ Scope.prototype.crawl = function () {
|
||||
|
||||
if (t.isFunction(block)) {
|
||||
for (i = 0; i < block.params.length; i++) {
|
||||
this.register(block.params[i], null, "let");
|
||||
this.register(block.params[i], null, "param");
|
||||
}
|
||||
this.traverse(block.body, blockVariableVisitor, this);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user