svelte 5.45.7 → 5.45.8

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "svelte",
3
3
  "description": "Cybernetically enhanced web apps",
4
4
  "license": "MIT",
5
- "version": "5.45.7",
5
+ "version": "5.45.8",
6
6
  "type": "module",
7
7
  "types": "./types/index.d.ts",
8
8
  "engines": {
@@ -117,21 +117,8 @@ export class Parser {
117
117
  e.unexpected_eof(this.index);
118
118
  }
119
119
 
120
- if (this.root.fragment.nodes.length) {
121
- let start = /** @type {number} */ (this.root.fragment.nodes[0].start);
122
- while (regex_whitespace.test(template[start])) start += 1;
123
-
124
- let end = /** @type {number} */ (
125
- this.root.fragment.nodes[this.root.fragment.nodes.length - 1].end
126
- );
127
- while (regex_whitespace.test(template[end - 1])) end -= 1;
128
-
129
- this.root.start = start;
130
- this.root.end = end;
131
- } else {
132
- // @ts-ignore
133
- this.root.start = this.root.end = null;
134
- }
120
+ this.root.start = 0;
121
+ this.root.end = template.length;
135
122
 
136
123
  const options_index = this.root.fragment.nodes.findIndex(
137
124
  /** @param {any} thing */
@@ -146,5 +146,15 @@ export function VariableDeclarator(node, context) {
146
146
  }
147
147
  }
148
148
 
149
- context.next();
149
+ if (node.init && get_rune(node.init, context.state.scope) === '$props') {
150
+ // prevent erroneous `state_referenced_locally` warnings on prop fallbacks
151
+ context.visit(node.id, {
152
+ ...context.state,
153
+ function_depth: context.state.function_depth + 1
154
+ });
155
+
156
+ context.visit(node.init);
157
+ } else {
158
+ context.next();
159
+ }
150
160
  }
package/src/version.js CHANGED
@@ -4,5 +4,5 @@
4
4
  * The current version, as set in package.json.
5
5
  * @type {string}
6
6
  */
7
- export const VERSION = '5.45.7';
7
+ export const VERSION = '5.45.8';
8
8
  export const PUBLIC_VERSION = '5';