babel-plugin-vasille 4.3.1 → 4.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/expression.js +12 -8
- package/package.json +1 -1
package/lib/expression.js
CHANGED
|
@@ -377,16 +377,20 @@ function checkExpression(nodePath, search) {
|
|
|
377
377
|
case "ObjectExpression": {
|
|
378
378
|
const path = nodePath;
|
|
379
379
|
for (const propPath of path.get("properties")) {
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
const
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
380
|
+
if (propPath.isObjectProperty()) {
|
|
381
|
+
const keyPath = propPath.get("key");
|
|
382
|
+
const valuePath = propPath.get("value");
|
|
383
|
+
if (propPath.node.computed ||
|
|
384
|
+
!(keyPath.isIdentifier() &&
|
|
385
|
+
valuePath.isIdentifier() &&
|
|
386
|
+
keyPath.node.name.startsWith("$") === valuePath.node.name.startsWith("$"))) {
|
|
387
|
+
if (propPath.node.computed) {
|
|
388
|
+
checkOrIgnoreExpression(propPath.get("key"), search);
|
|
389
|
+
}
|
|
390
|
+
checkOrIgnoreExpression(valuePath, search);
|
|
386
391
|
}
|
|
387
|
-
checkOrIgnoreExpression(valuePath, search);
|
|
388
392
|
}
|
|
389
|
-
else if (
|
|
393
|
+
else if (propPath.isObjectMethod()) {
|
|
390
394
|
checkFunction(propPath, search);
|
|
391
395
|
}
|
|
392
396
|
else {
|