@wevu/compiler 6.16.25 → 6.16.26

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.
Files changed (2) hide show
  1. package/dist/index.mjs +4 -0
  2. package/package.json +2 -2
package/dist/index.mjs CHANGED
@@ -5743,6 +5743,9 @@ function buildCtxValueAccess(member) {
5743
5743
  function isValueMemberObject(node, parent) {
5744
5744
  return t.isMemberExpression(parent) && parent.object === node && t.isIdentifier(parent.property, { name: "value" }) && !parent.computed;
5745
5745
  }
5746
+ function isCallTarget(node, parent) {
5747
+ return (t.isCallExpression(parent) || t.isOptionalCallExpression(parent) || t.isNewExpression(parent)) && parent.callee === node;
5748
+ }
5746
5749
  function rewriteTopLevelRefLikeAccess(ast, context) {
5747
5750
  traverse(ast, {
5748
5751
  AssignmentExpression(path) {
@@ -5761,6 +5764,7 @@ function rewriteTopLevelRefLikeAccess(ast, context) {
5761
5764
  traverse(ast, { MemberExpression(path) {
5762
5765
  if (!isRefLikeCtxMember(path.node, context)) return;
5763
5766
  if (isValueMemberObject(path.node, path.parentPath?.node)) return;
5767
+ if (isCallTarget(path.node, path.parentPath?.node)) return;
5764
5768
  path.replaceWith(buildCtxValueAccess(path.node));
5765
5769
  path.skip();
5766
5770
  } });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wevu/compiler",
3
3
  "type": "module",
4
- "version": "6.16.25",
4
+ "version": "6.16.26",
5
5
  "description": "wevu 编译器基础包,面向小程序模板的编译与转换",
6
6
  "author": "ice breaker <1324318532@qq.com>",
7
7
  "license": "MIT",
@@ -52,7 +52,7 @@
52
52
  "vue": "^3.5.34",
53
53
  "@weapp-core/constants": "0.1.10",
54
54
  "@weapp-core/shared": "3.0.4",
55
- "@weapp-vite/ast": "6.16.25",
55
+ "@weapp-vite/ast": "6.16.26",
56
56
  "rolldown-require": "2.0.17"
57
57
  },
58
58
  "publishConfig": {