babel-plugin-vasille 4.3.0 → 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/lib/mesh.js +6 -7
- 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 {
|
package/lib/mesh.js
CHANGED
|
@@ -1040,13 +1040,12 @@ function composeStatement(path, internal) {
|
|
|
1040
1040
|
(0, lib_js_1.checkNonReactiveName)(idPath, internal);
|
|
1041
1041
|
}
|
|
1042
1042
|
// const s = new Set(), const m = new Map()
|
|
1043
|
-
else if (initPath.isNewExpression() &&
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
}
|
|
1043
|
+
else if (initPath.isNewExpression() &&
|
|
1044
|
+
t.isIdentifier(initPath.node.callee) &&
|
|
1045
|
+
["Set", "Map"].includes(initPath.node.callee.name)) {
|
|
1046
|
+
(0, lib_js_1.processModelCall)(initPath, initPath.node.callee.name, kind === "const", internal, idName());
|
|
1047
|
+
meshInit = false;
|
|
1048
|
+
(0, lib_js_1.checkNonReactiveName)(idPath, internal);
|
|
1050
1049
|
}
|
|
1051
1050
|
else if (kind === "let") {
|
|
1052
1051
|
meshExpression(declaration.get("init"), internal);
|