@wevu/compiler 6.16.21 → 6.16.23

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 -1
  2. package/package.json +2 -2
package/dist/index.mjs CHANGED
@@ -2244,6 +2244,9 @@ function buildRuntimeExpressionErrorGuard(binding, errorId) {
2244
2244
  function shouldReportRuntimeExpressionError(binding) {
2245
2245
  return binding.type === "bind";
2246
2246
  }
2247
+ function shouldReportForSourceError(info) {
2248
+ return !(info.listExp?.trim() ?? "").startsWith(`${WEVU_SLOT_PROPS_DATA_KEY}.`);
2249
+ }
2247
2250
  function createDataPropsFallbackExpression(fallback) {
2248
2251
  const propsObject = t.memberExpression(t.thisExpression(), t.identifier(WEVU_PROPS_KEY));
2249
2252
  const propsAccess = t.memberExpression(propsObject, t.identifier("data"));
@@ -2334,7 +2337,7 @@ function buildForExpression(binding, forStack, level, helpers) {
2334
2337
  const unrefHelper = helpers.unref ? t.cloneNode(helpers.unref) : t.identifier("unref");
2335
2338
  const listUnrefExp = t.callExpression(unrefHelper, [listExp]);
2336
2339
  const listDecl = t.variableDeclaration("let", [t.variableDeclarator(listId, t.arrayExpression([]))]);
2337
- const listSafeAssign = t.tryStatement(t.blockStatement([t.expressionStatement(t.assignmentExpression("=", listId, listUnrefExp))]), t.catchClause(t.identifier(`__wv_err_${level}`), t.blockStatement([buildConsoleErrorGuard(`[wevu] 模板 v-for 数据源表达式执行失败: ${info.listExp}`, t.identifier(`__wv_err_${level}`)), t.expressionStatement(t.assignmentExpression("=", listId, t.arrayExpression([])))])), null);
2340
+ const listSafeAssign = t.tryStatement(t.blockStatement([t.expressionStatement(t.assignmentExpression("=", listId, listUnrefExp))]), t.catchClause(t.identifier(`__wv_err_${level}`), t.blockStatement([...shouldReportForSourceError(info) ? [buildConsoleErrorGuard(`[wevu] 模板 v-for 数据源表达式执行失败: ${info.listExp}`, t.identifier(`__wv_err_${level}`))] : [], t.expressionStatement(t.assignmentExpression("=", listId, t.arrayExpression([])))])), null);
2338
2341
  const arrayCheck = t.callExpression(t.memberExpression(t.identifier("Array"), t.identifier("isArray")), [listId]);
2339
2342
  const arrayMap = buildArrayMapExpression(binding, forStack, level, listId, helpers);
2340
2343
  const objectCheck = t.logicalExpression("&&", t.binaryExpression("!=", listId, t.nullLiteral()), t.binaryExpression("===", t.unaryExpression("typeof", listId), t.stringLiteral("object")));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wevu/compiler",
3
3
  "type": "module",
4
- "version": "6.16.21",
4
+ "version": "6.16.23",
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.9",
54
54
  "@weapp-core/shared": "3.0.4",
55
- "@weapp-vite/ast": "6.16.21",
55
+ "@weapp-vite/ast": "6.16.23",
56
56
  "rolldown-require": "2.0.17"
57
57
  },
58
58
  "publishConfig": {