Skip to content

Commit 6ac0779

Browse files
committed
dead code
1 parent e8997c3 commit 6ac0779

File tree

4 files changed

+6
-25
lines changed

4 files changed

+6
-25
lines changed

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

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -134,16 +134,14 @@ const visitors = {
134134

135135
/**
136136
* @param {ComponentAnalysis} analysis
137-
* @param {string} source
138137
* @param {ValidatedCompileOptions} options
139138
* @returns {ESTree.Program}
140139
*/
141-
export function client_component(analysis, source, options) {
140+
export function client_component(analysis, options) {
142141
/** @type {ComponentClientTransformState} */
143142
const state = {
144143
analysis,
145144
options,
146-
source: source.split('\n'),
147145
scope: analysis.module.scope,
148146
scopes: analysis.module.scopes,
149147
is_instance: false,
@@ -165,7 +163,6 @@ export function client_component(analysis, source, options) {
165163
private_state: new Map(),
166164
transform: {},
167165
in_constructor: false,
168-
trace_dependencies: false,
169166

170167
// these are set inside the `Fragment` visitor, and cannot be used until then
171168
before_init: /** @type {any} */ (null),
@@ -646,23 +643,20 @@ export function client_component(analysis, source, options) {
646643

647644
/**
648645
* @param {Analysis} analysis
649-
* @param {string} source
650646
* @param {ValidatedModuleCompileOptions} options
651647
* @returns {ESTree.Program}
652648
*/
653-
export function client_module(analysis, source, options) {
649+
export function client_module(analysis, options) {
654650
/** @type {ClientTransformState} */
655651
const state = {
656652
analysis,
657653
options,
658-
source: source.split('\n'),
659654
scope: analysis.module.scope,
660655
scopes: analysis.module.scopes,
661656
public_state: new Map(),
662657
private_state: new Map(),
663658
transform: {},
664-
in_constructor: false,
665-
trace_dependencies: false
659+
in_constructor: false
666660
};
667661

668662
const module = /** @type {ESTree.Program} */ (

packages/svelte/src/compiler/phases/3-transform/client/types.d.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ export interface ClientTransformState extends TransformState {
2323
*/
2424
readonly in_constructor: boolean;
2525

26-
readonly source: string[];
27-
28-
readonly trace_dependencies: boolean;
29-
3026
readonly transform: Record<
3127
string,
3228
{

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

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,7 @@ export function BlockStatement(node, context) {
1616
b.return(
1717
b.call(
1818
'$.trace',
19-
b.thunk(
20-
b.block(
21-
node.body.map(
22-
(n) =>
23-
/** @type {Statement} */ (
24-
context.visit(n, { ...context.state, trace_dependencies: true })
25-
)
26-
)
27-
)
28-
),
19+
b.thunk(b.block(node.body.map((n) => /** @type {Statement} */ (context.visit(n))))),
2920
b.literal(tracing)
3021
)
3122
)

packages/svelte/src/compiler/phases/3-transform/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export function transform_component(analysis, source, options) {
3030
const program =
3131
options.generate === 'server'
3232
? server_component(analysis, options)
33-
: client_component(analysis, source, options);
33+
: client_component(analysis, options);
3434

3535
const js_source_name = get_source_name(options.filename, options.outputFilename, 'input.svelte');
3636
const js = print(program, {
@@ -79,7 +79,7 @@ export function transform_module(analysis, source, options) {
7979
const program =
8080
options.generate === 'server'
8181
? server_module(analysis, options)
82-
: client_module(analysis, source, options);
82+
: client_module(analysis, options);
8383

8484
const basename = options.filename.split(/[/\\]/).at(-1);
8585
if (program.body.length > 0) {

0 commit comments

Comments
 (0)