We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
@const
1 parent 458cb37 commit 7b8f3a4Copy full SHA for 7b8f3a4
src/context/script-let.ts
@@ -247,7 +247,11 @@ export class ScriptLetContext {
247
parent: SvelteNode,
248
...callbacks: ScriptLetCallback<ESTree.VariableDeclarator>[]
249
): ScriptLetCallback<ESTree.VariableDeclarator>[] {
250
- const range = getNodeRange(declarator);
+ const range =
251
+ declarator.type === "VariableDeclarator"
252
+ ? // As of Svelte v5-next.65, VariableDeclarator nodes do not have location information.
253
+ [getNodeRange(declarator.id)[0], getNodeRange(declarator.init!)[1]]
254
+ : getNodeRange(declarator);
255
const part = this.ctx.code.slice(...range);
256
this.appendScript(
257
`const ${part};`,
0 commit comments