Skip to content

Commit 24b6fab

Browse files
authored
chore: construct analysis before module walk (#15108)
1 parent e9cc7dc commit 24b6fab

File tree

1 file changed

+10
-9
lines changed
  • packages/svelte/src/compiler/phases/2-analyze

1 file changed

+10
-9
lines changed

packages/svelte/src/compiler/phases/2-analyze/index.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,15 @@ export function analyze_module(ast, options) {
243243
}
244244
}
245245

246-
const analysis = { runes: true, tracing: false };
246+
/** @type {Analysis} */
247+
const analysis = {
248+
module: { ast, scope, scopes },
249+
name: options.filename,
250+
accessors: false,
251+
runes: true,
252+
immutable: true,
253+
tracing: false
254+
};
247255

248256
walk(
249257
/** @type {Node} */ (ast),
@@ -256,14 +264,7 @@ export function analyze_module(ast, options) {
256264
visitors
257265
);
258266

259-
return {
260-
module: { ast, scope, scopes },
261-
name: options.filename,
262-
accessors: false,
263-
runes: true,
264-
immutable: true,
265-
tracing: analysis.tracing
266-
};
267+
return analysis;
267268
}
268269

269270
/**

0 commit comments

Comments
 (0)