@vue/compiler-sfc 3.4.25 → 3.4.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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-sfc v3.4.25
2
+ * @vue/compiler-sfc v3.4.26
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -20763,7 +20763,7 @@ function isStaticNode(node) {
20763
20763
  return false;
20764
20764
  }
20765
20765
 
20766
- const version = "3.4.25";
20766
+ const version = "3.4.26";
20767
20767
  const parseCache = parseCache$1;
20768
20768
  const errorMessages = {
20769
20769
  ...CompilerDOM.errorMessages,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-sfc v3.4.25
2
+ * @vue/compiler-sfc v3.4.26
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -17247,11 +17247,10 @@ const tokenizer$2 = new Tokenizer$1(stack, {
17247
17247
  }
17248
17248
  },
17249
17249
  onselfclosingtag(end) {
17250
- var _a;
17251
17250
  const name = currentOpenTag.tag;
17252
17251
  currentOpenTag.isSelfClosing = true;
17253
17252
  endOpenTag(end);
17254
- if (((_a = stack[0]) == null ? void 0 : _a.tag) === name) {
17253
+ if (stack[0] && stack[0].tag === name) {
17255
17254
  onCloseTag(stack.shift(), end);
17256
17255
  }
17257
17256
  },
@@ -17557,7 +17556,7 @@ function endOpenTag(end) {
17557
17556
  function onText(content, start, end) {
17558
17557
  const parent = stack[0] || currentRoot;
17559
17558
  const lastNode = parent.children[parent.children.length - 1];
17560
- if ((lastNode == null ? void 0 : lastNode.type) === 2) {
17559
+ if (lastNode && lastNode.type === 2) {
17561
17560
  lastNode.content += content;
17562
17561
  setLocEnd(lastNode.loc, end);
17563
17562
  } else {
@@ -17633,11 +17632,10 @@ function isFragmentTemplate({ tag, props }) {
17633
17632
  return false;
17634
17633
  }
17635
17634
  function isComponent({ tag, props }) {
17636
- var _a;
17637
17635
  if (currentOptions.isCustomElement(tag)) {
17638
17636
  return false;
17639
17637
  }
17640
- if (tag === "component" || isUpperCase(tag.charCodeAt(0)) || isCoreComponent(tag) || ((_a = currentOptions.isBuiltInComponent) == null ? void 0 : _a.call(currentOptions, tag)) || currentOptions.isNativeTag && !currentOptions.isNativeTag(tag)) {
17638
+ if (tag === "component" || isUpperCase(tag.charCodeAt(0)) || isCoreComponent(tag) || currentOptions.isBuiltInComponent && currentOptions.isBuiltInComponent(tag) || currentOptions.isNativeTag && !currentOptions.isNativeTag(tag)) {
17641
17639
  return true;
17642
17640
  }
17643
17641
  for (let i = 0; i < props.length; i++) {
@@ -17657,7 +17655,6 @@ function isUpperCase(c) {
17657
17655
  }
17658
17656
  const windowsNewlineRE = /\r\n/g;
17659
17657
  function condenseWhitespace(nodes, tag) {
17660
- var _a, _b;
17661
17658
  const shouldCondense = currentOptions.whitespace !== "preserve";
17662
17659
  let removedWhitespace = false;
17663
17660
  for (let i = 0; i < nodes.length; i++) {
@@ -17665,8 +17662,8 @@ function condenseWhitespace(nodes, tag) {
17665
17662
  if (node.type === 2) {
17666
17663
  if (!inPre) {
17667
17664
  if (isAllWhitespace(node.content)) {
17668
- const prev = (_a = nodes[i - 1]) == null ? void 0 : _a.type;
17669
- const next = (_b = nodes[i + 1]) == null ? void 0 : _b.type;
17665
+ const prev = nodes[i - 1] && nodes[i - 1].type;
17666
+ const next = nodes[i + 1] && nodes[i + 1].type;
17670
17667
  if (!prev || !next || shouldCondense && (prev === 3 && (next === 3 || next === 1) || prev === 1 && (next === 3 || next === 1 && hasNewlineChar(node.content)))) {
17671
17668
  removedWhitespace = true;
17672
17669
  nodes[i] = null;
@@ -17826,7 +17823,7 @@ function baseParse(input, options) {
17826
17823
  }
17827
17824
  tokenizer$2.mode = currentOptions.parseMode === "html" ? 1 : currentOptions.parseMode === "sfc" ? 2 : 0;
17828
17825
  tokenizer$2.inXML = currentOptions.ns === 1 || currentOptions.ns === 2;
17829
- const delimiters = options == null ? void 0 : options.delimiters;
17826
+ const delimiters = options && options.delimiters;
17830
17827
  if (delimiters) {
17831
17828
  tokenizer$2.delimiterOpen = toCharCodes(delimiters[0]);
17832
17829
  tokenizer$2.delimiterClose = toCharCodes(delimiters[1]);
@@ -22510,7 +22507,6 @@ function genReturnStatement({ returns }, context) {
22510
22507
  }
22511
22508
 
22512
22509
  const isLiteralWhitelisted = /* @__PURE__ */ makeMap("true,false,null,this");
22513
- const constantBailRE = /\w\s*\(|\.[^\d]/;
22514
22510
  const transformExpression = (node, context) => {
22515
22511
  if (node.type === 5) {
22516
22512
  node.content = processExpression(
@@ -22605,7 +22601,6 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
22605
22601
  return `_ctx.${raw}`;
22606
22602
  };
22607
22603
  const rawExp = node.content;
22608
- const bailConstant = constantBailRE.test(rawExp);
22609
22604
  let ast = node.ast;
22610
22605
  if (ast === false) {
22611
22606
  return node;
@@ -22664,7 +22659,7 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
22664
22659
  node2.name = rewriteIdentifier(node2.name, parent, node2);
22665
22660
  ids.push(node2);
22666
22661
  } else {
22667
- if (!(needPrefix && isLocal) && !bailConstant) {
22662
+ if (!(needPrefix && isLocal) && parent.type !== "CallExpression" && parent.type !== "NewExpression" && parent.type !== "MemberExpression") {
22668
22663
  node2.isConstant = true;
22669
22664
  }
22670
22665
  ids.push(node2);
@@ -22708,7 +22703,7 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
22708
22703
  ret.ast = ast;
22709
22704
  } else {
22710
22705
  ret = node;
22711
- ret.constType = bailConstant ? 0 : 3;
22706
+ ret.constType = 3;
22712
22707
  }
22713
22708
  ret.identifiers = Object.keys(knownIds);
22714
22709
  return ret;
@@ -48369,7 +48364,7 @@ var __spreadValues = (a, b) => {
48369
48364
  }
48370
48365
  return a;
48371
48366
  };
48372
- const version = "3.4.25";
48367
+ const version = "3.4.26";
48373
48368
  const parseCache = parseCache$1;
48374
48369
  const errorMessages = __spreadValues(__spreadValues({}, errorMessages$1), DOMErrorMessages);
48375
48370
  const walk = walk$2;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/compiler-sfc",
3
- "version": "3.4.25",
3
+ "version": "3.4.26",
4
4
  "description": "@vue/compiler-sfc",
5
5
  "main": "dist/compiler-sfc.cjs.js",
6
6
  "module": "dist/compiler-sfc.esm-browser.js",
@@ -47,10 +47,10 @@
47
47
  "magic-string": "^0.30.10",
48
48
  "postcss": "^8.4.38",
49
49
  "source-map-js": "^1.2.0",
50
- "@vue/compiler-core": "3.4.25",
51
- "@vue/compiler-ssr": "3.4.25",
52
- "@vue/compiler-dom": "3.4.25",
53
- "@vue/shared": "3.4.25"
50
+ "@vue/compiler-core": "3.4.26",
51
+ "@vue/shared": "3.4.26",
52
+ "@vue/compiler-dom": "3.4.26",
53
+ "@vue/compiler-ssr": "3.4.26"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@babel/types": "^7.24.0",