File tree 2 files changed +3
-10
lines changed
packages/svelte/src/compiler/phases
2-analyze/visitors/shared
3-transform/client/visitors/shared
2 files changed +3
-10
lines changed Original file line number Diff line number Diff line change 1
1
/** @import { AssignmentExpression, PropertyDefinition, Expression } from 'estree' */
2
2
/** @import { AST } from '#compiler' */
3
3
/** @import { Context } from '../../types' */
4
+ /** @import { StateCreationRuneName } from '../../../../../utils.js' */
4
5
5
6
import { get_parent } from '../../../../utils/ast.js' ;
6
7
import { get_rune } from '../../../scope.js' ;
7
8
import * as e from '../../../../errors.js' ;
8
9
import { locate_node } from '../../../../state.js' ;
9
10
import { is_state_creation_rune } from '../../../../../utils.js' ;
10
11
11
- /** @typedef {'$state' | '$state.raw' | '$derived' | '$derived.by' | 'regular' } PropertyAssignmentType */
12
+ /** @typedef { StateCreationRuneName | 'regular' } PropertyAssignmentType */
12
13
/** @typedef {{ type: PropertyAssignmentType; node: AssignmentExpression | PropertyDefinition; } } PropertyAssignmentDetails */
13
14
14
15
const reassignable_assignments = new Set ( [ '$state' , '$state.raw' , 'regular' ] ) ;
15
16
16
- const property_assignment_types = new Set ( [
17
- '$state' ,
18
- '$state.raw' ,
19
- '$derived' ,
20
- '$derived.by' ,
21
- 'regular'
22
- ] ) ;
23
-
24
17
export class ClassAnalysis {
25
18
// TODO: Probably need to include property definitions here too
26
19
/** @type {Map<string, PropertyAssignmentDetails> } */
Original file line number Diff line number Diff line change @@ -121,7 +121,7 @@ export class ClassAnalysis {
121
121
122
122
const rune = get_rune ( node . right , context . state . scope ) ;
123
123
if ( ! rune || ! is_state_creation_rune ( rune ) ) {
124
- return false ;
124
+ return ;
125
125
}
126
126
127
127
const id = this . #deconflict( name ) ;
You can’t perform that action at this time.
0 commit comments