@vue/compiler-core 3.4.34 → 3.4.36

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-core v3.4.34
2
+ * @vue/compiler-core v3.4.36
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -8,7 +8,7 @@
8
8
  Object.defineProperty(exports, '__esModule', { value: true });
9
9
 
10
10
  var shared = require('@vue/shared');
11
- var decode_js = require('entities/lib/decode.js');
11
+ var decode_js = require('entities/dist/decode.js');
12
12
  var parser = require('@babel/parser');
13
13
  var estreeWalker = require('estree-walker');
14
14
  var sourceMapJs = require('source-map-js');
@@ -1538,6 +1538,16 @@ function walkIdentifiers(root, onIdentifier, includeAll = false, parentStack = [
1538
1538
  (id) => markScopeIdentifier(node, id, knownIds)
1539
1539
  );
1540
1540
  }
1541
+ } else if (node.type === "CatchClause" && node.param) {
1542
+ for (const id of extractIdentifiers(node.param)) {
1543
+ markScopeIdentifier(node, id, knownIds);
1544
+ }
1545
+ } else if (isForStatement(node)) {
1546
+ walkForStatement(
1547
+ node,
1548
+ false,
1549
+ (id) => markScopeIdentifier(node, id, knownIds)
1550
+ );
1541
1551
  }
1542
1552
  },
1543
1553
  leave(node, parent) {
@@ -1618,14 +1628,20 @@ function walkBlockDeclarations(block, onIdent) {
1618
1628
  } else if (stmt.type === "FunctionDeclaration" || stmt.type === "ClassDeclaration") {
1619
1629
  if (stmt.declare || !stmt.id) continue;
1620
1630
  onIdent(stmt.id);
1621
- } else if (stmt.type === "ForOfStatement" || stmt.type === "ForInStatement" || stmt.type === "ForStatement") {
1622
- const variable = stmt.type === "ForStatement" ? stmt.init : stmt.left;
1623
- if (variable && variable.type === "VariableDeclaration") {
1624
- for (const decl of variable.declarations) {
1625
- for (const id of extractIdentifiers(decl.id)) {
1626
- onIdent(id);
1627
- }
1628
- }
1631
+ } else if (isForStatement(stmt)) {
1632
+ walkForStatement(stmt, true, onIdent);
1633
+ }
1634
+ }
1635
+ }
1636
+ function isForStatement(stmt) {
1637
+ return stmt.type === "ForOfStatement" || stmt.type === "ForInStatement" || stmt.type === "ForStatement";
1638
+ }
1639
+ function walkForStatement(stmt, isVar, onIdent) {
1640
+ const variable = stmt.type === "ForStatement" ? stmt.init : stmt.left;
1641
+ if (variable && variable.type === "VariableDeclaration" && (variable.kind === "var" ? isVar : !isVar)) {
1642
+ for (const decl of variable.declarations) {
1643
+ for (const id of extractIdentifiers(decl.id)) {
1644
+ onIdent(id);
1629
1645
  }
1630
1646
  }
1631
1647
  }
@@ -1712,7 +1728,7 @@ function isReferenced(node, parent, grandparent) {
1712
1728
  if (parent.key === node) {
1713
1729
  return !!parent.computed;
1714
1730
  }
1715
- return !grandparent ;
1731
+ return !grandparent;
1716
1732
  case "ClassProperty":
1717
1733
  if (parent.key === node) {
1718
1734
  return !!parent.computed;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-core v3.4.34
2
+ * @vue/compiler-core v3.4.36
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -8,7 +8,7 @@
8
8
  Object.defineProperty(exports, '__esModule', { value: true });
9
9
 
10
10
  var shared = require('@vue/shared');
11
- var decode_js = require('entities/lib/decode.js');
11
+ var decode_js = require('entities/dist/decode.js');
12
12
  var parser = require('@babel/parser');
13
13
  var estreeWalker = require('estree-walker');
14
14
  var sourceMapJs = require('source-map-js');
@@ -1534,6 +1534,16 @@ function walkIdentifiers(root, onIdentifier, includeAll = false, parentStack = [
1534
1534
  (id) => markScopeIdentifier(node, id, knownIds)
1535
1535
  );
1536
1536
  }
1537
+ } else if (node.type === "CatchClause" && node.param) {
1538
+ for (const id of extractIdentifiers(node.param)) {
1539
+ markScopeIdentifier(node, id, knownIds);
1540
+ }
1541
+ } else if (isForStatement(node)) {
1542
+ walkForStatement(
1543
+ node,
1544
+ false,
1545
+ (id) => markScopeIdentifier(node, id, knownIds)
1546
+ );
1537
1547
  }
1538
1548
  },
1539
1549
  leave(node, parent) {
@@ -1614,14 +1624,20 @@ function walkBlockDeclarations(block, onIdent) {
1614
1624
  } else if (stmt.type === "FunctionDeclaration" || stmt.type === "ClassDeclaration") {
1615
1625
  if (stmt.declare || !stmt.id) continue;
1616
1626
  onIdent(stmt.id);
1617
- } else if (stmt.type === "ForOfStatement" || stmt.type === "ForInStatement" || stmt.type === "ForStatement") {
1618
- const variable = stmt.type === "ForStatement" ? stmt.init : stmt.left;
1619
- if (variable && variable.type === "VariableDeclaration") {
1620
- for (const decl of variable.declarations) {
1621
- for (const id of extractIdentifiers(decl.id)) {
1622
- onIdent(id);
1623
- }
1624
- }
1627
+ } else if (isForStatement(stmt)) {
1628
+ walkForStatement(stmt, true, onIdent);
1629
+ }
1630
+ }
1631
+ }
1632
+ function isForStatement(stmt) {
1633
+ return stmt.type === "ForOfStatement" || stmt.type === "ForInStatement" || stmt.type === "ForStatement";
1634
+ }
1635
+ function walkForStatement(stmt, isVar, onIdent) {
1636
+ const variable = stmt.type === "ForStatement" ? stmt.init : stmt.left;
1637
+ if (variable && variable.type === "VariableDeclaration" && (variable.kind === "var" ? isVar : !isVar)) {
1638
+ for (const decl of variable.declarations) {
1639
+ for (const id of extractIdentifiers(decl.id)) {
1640
+ onIdent(id);
1625
1641
  }
1626
1642
  }
1627
1643
  }
@@ -1708,7 +1724,7 @@ function isReferenced(node, parent, grandparent) {
1708
1724
  if (parent.key === node) {
1709
1725
  return !!parent.computed;
1710
1726
  }
1711
- return !grandparent ;
1727
+ return !grandparent;
1712
1728
  case "ClassProperty":
1713
1729
  if (parent.key === node) {
1714
1730
  return !!parent.computed;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-core v3.4.34
2
+ * @vue/compiler-core v3.4.36
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1489,14 +1489,20 @@ function walkBlockDeclarations(block, onIdent) {
1489
1489
  } else if (stmt.type === "FunctionDeclaration" || stmt.type === "ClassDeclaration") {
1490
1490
  if (stmt.declare || !stmt.id) continue;
1491
1491
  onIdent(stmt.id);
1492
- } else if (stmt.type === "ForOfStatement" || stmt.type === "ForInStatement" || stmt.type === "ForStatement") {
1493
- const variable = stmt.type === "ForStatement" ? stmt.init : stmt.left;
1494
- if (variable && variable.type === "VariableDeclaration") {
1495
- for (const decl of variable.declarations) {
1496
- for (const id of extractIdentifiers(decl.id)) {
1497
- onIdent(id);
1498
- }
1499
- }
1492
+ } else if (isForStatement(stmt)) {
1493
+ walkForStatement(stmt, true, onIdent);
1494
+ }
1495
+ }
1496
+ }
1497
+ function isForStatement(stmt) {
1498
+ return stmt.type === "ForOfStatement" || stmt.type === "ForInStatement" || stmt.type === "ForStatement";
1499
+ }
1500
+ function walkForStatement(stmt, isVar, onIdent) {
1501
+ const variable = stmt.type === "ForStatement" ? stmt.init : stmt.left;
1502
+ if (variable && variable.type === "VariableDeclaration" && (variable.kind === "var" ? isVar : !isVar)) {
1503
+ for (const decl of variable.declarations) {
1504
+ for (const id of extractIdentifiers(decl.id)) {
1505
+ onIdent(id);
1500
1506
  }
1501
1507
  }
1502
1508
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/compiler-core",
3
- "version": "3.4.34",
3
+ "version": "3.4.36",
4
4
  "description": "@vue/compiler-core",
5
5
  "main": "index.js",
6
6
  "module": "dist/compiler-core.esm-bundler.js",
@@ -47,10 +47,10 @@
47
47
  "homepage": "https://github.com/vuejs/core/tree/main/packages/compiler-core#readme",
48
48
  "dependencies": {
49
49
  "@babel/parser": "^7.24.7",
50
- "entities": "^4.5.0",
50
+ "entities": "^5.0.0",
51
51
  "estree-walker": "^2.0.2",
52
52
  "source-map-js": "^1.2.0",
53
- "@vue/shared": "3.4.34"
53
+ "@vue/shared": "3.4.36"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@babel/types": "^7.24.7"