better let scoping CallExpression comments and layout
This commit is contained in:
parent
7cc75587c1
commit
79f2dbb8d7
@ -26,16 +26,16 @@ exports.VariableDeclaration = function (node, parent, file) {
|
|||||||
// we're a property key
|
// we're a property key
|
||||||
if (parent.type === "Property" && parent.key === node) return;
|
if (parent.type === "Property" && parent.key === node) return;
|
||||||
|
|
||||||
if (parent.type !== "MemberExpression") {
|
var isMemberExpression = parent.type === "MemberExpression";
|
||||||
// we aren't in a member expression
|
|
||||||
return id;
|
// we're in a member expression and we're the computed property so we're referenced
|
||||||
} else if (parent.type === "MemberExpression" && parent.property === node && parent.computed) {
|
var isComputedProperty = isMemberExpression && parent.property === node && parent.computed;
|
||||||
// we're in a member expression but we're a computed property so we're referenced
|
|
||||||
return id;
|
// we're in a member expression and we're the object so we're referenced
|
||||||
} else if (parent.type === "MemberExpression" && parent.object === node) {
|
var isObject = isMemberExpression && parent.object === node;
|
||||||
// we're in a member expression and we're the object so we're referenced
|
|
||||||
return id;
|
// we are referenced
|
||||||
}
|
if (!isMemberExpression || isComputedProperty || isObject) return id;
|
||||||
};
|
};
|
||||||
|
|
||||||
var replace = function (node, parent) {
|
var replace = function (node, parent) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user