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];
|
var node = block[key];
|
||||||
if (t.isLet(node)) add(node);
|
if (t.isLet(node)) add(node);
|
||||||
});
|
});
|
||||||
|
|
||||||
block = block.body;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Program, BlockStatement - let variables
|
// Program, BlockStatement - let variables
|
||||||
@ -156,6 +154,12 @@ Scope.prototype.getInfo = function () {
|
|||||||
add(block.param);
|
add(block.param);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ComprehensionExpression - blocks
|
||||||
|
|
||||||
|
if (t.isComprehensionExpression(block)) {
|
||||||
|
add(block);
|
||||||
|
}
|
||||||
|
|
||||||
// Program, Function - var variables
|
// Program, Function - var variables
|
||||||
|
|
||||||
if (t.isProgram(block) || t.isFunction(block)) {
|
if (t.isProgram(block) || t.isFunction(block)) {
|
||||||
|
|||||||
@ -16,6 +16,7 @@
|
|||||||
"VariableDeclaration": ["Statement", "Declaration"],
|
"VariableDeclaration": ["Statement", "Declaration"],
|
||||||
"ExportDeclaration": ["Statement", "Declaration"],
|
"ExportDeclaration": ["Statement", "Declaration"],
|
||||||
"ImportDeclaration": ["Statement", "Declaration"],
|
"ImportDeclaration": ["Statement", "Declaration"],
|
||||||
|
"PrivateDeclaration": ["Statement", "Declaration"],
|
||||||
|
|
||||||
"ArrowFunctionExpression": ["Scope", "Function", "Expression"],
|
"ArrowFunctionExpression": ["Scope", "Function", "Expression"],
|
||||||
"FunctionDeclaration": ["Statement", "Declaration", "Scope", "Function"],
|
"FunctionDeclaration": ["Statement", "Declaration", "Scope", "Function"],
|
||||||
@ -52,7 +53,7 @@
|
|||||||
"BindFunctionExpression": ["Expression"],
|
"BindFunctionExpression": ["Expression"],
|
||||||
"BindMemberExpression": ["Expression"],
|
"BindMemberExpression": ["Expression"],
|
||||||
"CallExpression": ["Expression"],
|
"CallExpression": ["Expression"],
|
||||||
"ComprehensionExpression": ["Expression"],
|
"ComprehensionExpression": ["Expression", "Scope"],
|
||||||
"ConditionalExpression": ["Expression"],
|
"ConditionalExpression": ["Expression"],
|
||||||
"Identifier": ["Expression"],
|
"Identifier": ["Expression"],
|
||||||
"Literal": ["Expression"],
|
"Literal": ["Expression"],
|
||||||
|
|||||||
@ -472,10 +472,13 @@ t.getIds.nodes = {
|
|||||||
ClassDeclaration: ["id"],
|
ClassDeclaration: ["id"],
|
||||||
MemeberExpression: ["object"],
|
MemeberExpression: ["object"],
|
||||||
SpreadElement: ["argument"],
|
SpreadElement: ["argument"],
|
||||||
Property: ["value"]
|
Property: ["value"],
|
||||||
|
ComprehensionBlock: ["left"]
|
||||||
};
|
};
|
||||||
|
|
||||||
t.getIds.arrays = {
|
t.getIds.arrays = {
|
||||||
|
PrivateDeclaration: ["declarations"],
|
||||||
|
ComprehensionExpression: ["blocks"],
|
||||||
ExportDeclaration: ["specifiers", "declaration"],
|
ExportDeclaration: ["specifiers", "declaration"],
|
||||||
ImportDeclaration: ["specifiers"],
|
ImportDeclaration: ["specifiers"],
|
||||||
VariableDeclaration: ["declarations"],
|
VariableDeclaration: ["declarations"],
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user