Skip to content

Commit 777ebb3

Browse files
committed
fix
1 parent 302d775 commit 777ebb3

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

packages/svelte/src/compiler/legacy.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,11 +353,12 @@ export function convert(source, ast) {
353353
};
354354
}
355355

356+
const start = node.elseif ? node.consequent.nodes[0].start : node.start;
356357
remove_surrounding_whitespace_nodes(node.consequent.nodes);
357358

358359
return {
359360
type: 'IfBlock',
360-
start: node.elseif ? node.consequent.nodes[0].start : node.start,
361+
start,
361362
end: node.end,
362363
expression: node.test,
363364
children: node.consequent.nodes.map(

packages/svelte/tests/parser-legacy/samples/if-block-elseif/output.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
"children": [
8383
{
8484
"type": "IfBlock",
85-
"start": 60,
85+
"start": 58,
8686
"end": 89,
8787
"expression": {
8888
"type": "BinaryExpression",

0 commit comments

Comments
 (0)