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