Skip to content

Commit c3501f8

Browse files
committed
simplify
1 parent 8865a99 commit c3501f8

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

packages/svelte/src/compiler/phases/3-transform/client/visitors/RegularElement.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -294,14 +294,11 @@ export function RegularElement(node, context) {
294294

295295
context.state.template.push('>');
296296

297-
/** @type {SourceLocation[]} */
298-
const child_locations = [];
299-
300297
/** @type {ComponentClientTransformState} */
301298
const state = {
302299
...context.state,
303300
metadata: child_metadata,
304-
locations: child_locations,
301+
locations: [],
305302
scope: /** @type {Scope} */ (context.state.scopes.get(node.fragment)),
306303
preserve_whitespace:
307304
context.state.preserve_whitespace || node.name === 'pre' || node.name === 'textarea'
@@ -391,9 +388,9 @@ export function RegularElement(node, context) {
391388
context.state.update.push(b.stmt(b.assignment('=', dir, dir)));
392389
}
393390

394-
if (child_locations.length > 0) {
391+
if (state.locations.length > 0) {
395392
// @ts-expect-error
396-
location.push(child_locations);
393+
location.push(state.locations);
397394
}
398395

399396
if (!is_void(node.name)) {

0 commit comments

Comments
 (0)