fix(javascript): bind named class expressions in their class scope (#510)
* fix(javascript): bind named class expressions in their class scope Signed-off-by: RudyCelekli <[email protected]> * test(javascript): isolate class expression lexical names regression cases Signed-off-by: RudyCelekli <[email protected]> --------- Signed-off-by: RudyCelekli <[email protected]>
This commit is contained in:
1 parent
488fd5f60b
commit
55f0267c40
2 files changed
+54
No files matched your search
@@ -213,6 +213,16 @@ const bindInnerDeclaration = (
|
||||
? parent.kind !== "const"
|
||||
: true,
|
||||
});
|
||||
else if (t.isClassExpression(node) && t.isIdentifier(node.id))
|
||||
addBinding({
|
||||
state,
|
||||
scope,
|
||||
name: node.id.name,
|
||||
kind: "class",
|
||||
mutable: false,
|
||||
definitionNode: node.id,
|
||||
initializer: node,
|
||||
});
|
||||
else if (t.isFunction(node)) bindFunctionLocals(node, scope, state);
|
||||
else if (t.isCatchClause(node) && node.param != null)
|
||||
bindPattern({
|
||||
|
||||
Reference in new issue
Block a user