add private declaration and comprehension expression support to scope tracking and id building
This commit is contained in:
parent
529544ce0e
commit
621e66e9ac
@ -137,8 +137,6 @@ Scope.prototype.getInfo = function () {
|
||||
var node = block[key];
|
||||
if (t.isLet(node)) add(node);
|
||||
});
|
||||
|
||||
block = block.body;
|
||||
}
|
||||
|
||||
// Program, BlockStatement - let variables
|
||||
@ -156,6 +154,12 @@ Scope.prototype.getInfo = function () {
|
||||
add(block.param);
|
||||
}
|
||||
|
||||
// ComprehensionExpression - blocks
|
||||
|
||||
if (t.isComprehensionExpression(block)) {
|
||||
add(block);
|
||||
}
|
||||
|
||||
// Program, Function - var variables
|
||||
|
||||
if (t.isProgram(block) || t.isFunction(block)) {
|
||||
|
||||
@ -16,6 +16,7 @@
|
||||
"VariableDeclaration": ["Statement", "Declaration"],
|
||||
"ExportDeclaration": ["Statement", "Declaration"],
|
||||
"ImportDeclaration": ["Statement", "Declaration"],
|
||||
"PrivateDeclaration": ["Statement", "Declaration"],
|
||||
|
||||
"ArrowFunctionExpression": ["Scope", "Function", "Expression"],
|
||||
"FunctionDeclaration": ["Statement", "Declaration", "Scope", "Function"],
|
||||
@ -52,7 +53,7 @@
|
||||
"BindFunctionExpression": ["Expression"],
|
||||
"BindMemberExpression": ["Expression"],
|
||||
"CallExpression": ["Expression"],
|
||||
"ComprehensionExpression": ["Expression"],
|
||||
"ComprehensionExpression": ["Expression", "Scope"],
|
||||
"ConditionalExpression": ["Expression"],
|
||||
"Identifier": ["Expression"],
|
||||
"Literal": ["Expression"],
|
||||
|
||||
@ -472,10 +472,13 @@ t.getIds.nodes = {
|
||||
ClassDeclaration: ["id"],
|
||||
MemeberExpression: ["object"],
|
||||
SpreadElement: ["argument"],
|
||||
Property: ["value"]
|
||||
Property: ["value"],
|
||||
ComprehensionBlock: ["left"]
|
||||
};
|
||||
|
||||
t.getIds.arrays = {
|
||||
PrivateDeclaration: ["declarations"],
|
||||
ComprehensionExpression: ["blocks"],
|
||||
ExportDeclaration: ["specifiers", "declaration"],
|
||||
ImportDeclaration: ["specifiers"],
|
||||
VariableDeclaration: ["declarations"],
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user