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 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
- const prop = propPath.node;
381
- if (t.isObjectProperty(prop)) {
382
- const path = propPath;
383
- const valuePath = path.get("value");
384
- if (path.node.computed) {
385
- checkOrIgnoreExpression(path.get("key"), search);
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 (t.isObjectMethod(prop)) {
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() && t.isIdentifier(initPath.node.callee)) {
1044
- const name = initPath.node.callee.name;
1045
- if (name === "Map" || name === "Set") {
1046
- (0, lib_js_1.processModelCall)(initPath, name, kind === "const", internal, idName());
1047
- meshInit = false;
1048
- (0, lib_js_1.checkNonReactiveName)(idPath, internal);
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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "babel-plugin-vasille",
3
- "version": "4.3.0",
3
+ "version": "4.3.2",
4
4
  "description": "Convert Vasille Meta Language code to pure JavaScript",
5
5
  "main": "lib/index.js",
6
6
  "type": "commonjs",