Skip to content

Commit 4d6422c

Browse files
improvements
1 parent 005ba29 commit 4d6422c

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

packages/svelte/src/compiler/phases/2-analyze/visitors/shared/class-analysis.js

+2-9
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,19 @@
11
/** @import { AssignmentExpression, PropertyDefinition, Expression } from 'estree' */
22
/** @import { AST } from '#compiler' */
33
/** @import { Context } from '../../types' */
4+
/** @import { StateCreationRuneName } from '../../../../../utils.js' */
45

56
import { get_parent } from '../../../../utils/ast.js';
67
import { get_rune } from '../../../scope.js';
78
import * as e from '../../../../errors.js';
89
import { locate_node } from '../../../../state.js';
910
import { is_state_creation_rune } from '../../../../../utils.js';
1011

11-
/** @typedef {'$state' | '$state.raw' | '$derived' | '$derived.by' | 'regular'} PropertyAssignmentType */
12+
/** @typedef { StateCreationRuneName | 'regular'} PropertyAssignmentType */
1213
/** @typedef {{ type: PropertyAssignmentType; node: AssignmentExpression | PropertyDefinition; }} PropertyAssignmentDetails */
1314

1415
const reassignable_assignments = new Set(['$state', '$state.raw', 'regular']);
1516

16-
const property_assignment_types = new Set([
17-
'$state',
18-
'$state.raw',
19-
'$derived',
20-
'$derived.by',
21-
'regular'
22-
]);
23-
2417
export class ClassAnalysis {
2518
// TODO: Probably need to include property definitions here too
2619
/** @type {Map<string, PropertyAssignmentDetails>} */

packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/class-analysis.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ export class ClassAnalysis {
121121

122122
const rune = get_rune(node.right, context.state.scope);
123123
if (!rune || !is_state_creation_rune(rune)) {
124-
return false;
124+
return;
125125
}
126126

127127
const id = this.#deconflict(name);

0 commit comments

Comments
 (0)