@marko/language-tools 2.5.45 → 2.5.46

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/dist/index.js CHANGED
@@ -1386,8 +1386,15 @@ function getHoistSources(body) {
1386
1386
  }
1387
1387
  function isMutatedVar(node, name) {
1388
1388
  var _a;
1389
- const binding = (_a = Scopes.get(node.body).bindings) == null ? void 0 : _a[name];
1390
- return (binding == null ? void 0 : binding.type) === 0 /* var */ && binding.mutated;
1389
+ let scope = Scopes.get(node.body);
1390
+ while (scope) {
1391
+ const binding = (_a = scope.bindings) == null ? void 0 : _a[name];
1392
+ if ((binding == null ? void 0 : binding.type) === 0 /* var */ && binding.mutated) {
1393
+ return true;
1394
+ }
1395
+ scope = scope.parent;
1396
+ }
1397
+ return false;
1391
1398
  }
1392
1399
  function hasHoists(node) {
1393
1400
  return node.body ? Scopes.get(node.body).hoists : false;
package/dist/index.mjs CHANGED
@@ -1346,8 +1346,15 @@ function getHoistSources(body) {
1346
1346
  }
1347
1347
  function isMutatedVar(node, name) {
1348
1348
  var _a;
1349
- const binding = (_a = Scopes.get(node.body).bindings) == null ? void 0 : _a[name];
1350
- return (binding == null ? void 0 : binding.type) === 0 /* var */ && binding.mutated;
1349
+ let scope = Scopes.get(node.body);
1350
+ while (scope) {
1351
+ const binding = (_a = scope.bindings) == null ? void 0 : _a[name];
1352
+ if ((binding == null ? void 0 : binding.type) === 0 /* var */ && binding.mutated) {
1353
+ return true;
1354
+ }
1355
+ scope = scope.parent;
1356
+ }
1357
+ return false;
1351
1358
  }
1352
1359
  function hasHoists(node) {
1353
1360
  return node.body ? Scopes.get(node.body).hoists : false;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@marko/language-tools",
3
3
  "description": "Marko Language Tools",
4
- "version": "2.5.45",
4
+ "version": "2.5.46",
5
5
  "bugs": "https://github.com/marko-js/language-server/issues/new?template=Bug_report.md",
6
6
  "peerDependencies": {
7
7
  "@marko/compiler": "^5.28.4"