@@ -141,12 +141,12 @@ export function VariableDeclaration(node, context) {
141
141
b . declarator ( declarator . id , create_state_declarator ( declarator . id , value ) )
142
142
) ;
143
143
} else {
144
- const tmp = context . state . scope . generate ( 'tmp' ) ;
144
+ const tmp = b . id ( context . state . scope . generate ( 'tmp' ) ) ;
145
145
const paths = extract_paths ( declarator . id ) ;
146
146
declarations . push (
147
- b . declarator ( b . id ( tmp ) , value ) ,
147
+ b . declarator ( tmp , value ) ,
148
148
...paths . map ( ( path ) => {
149
- const value = path . expression ?. ( b . id ( tmp ) ) ;
149
+ const value = path . expression ?. ( tmp ) ;
150
150
const binding = context . state . scope . get ( /** @type {Identifier } */ ( path . node ) . name ) ;
151
151
return b . declarator (
152
152
path . node ,
@@ -170,7 +170,7 @@ export function VariableDeclaration(node, context) {
170
170
)
171
171
) ;
172
172
} else {
173
- const bindings = extract_paths ( declarator . id ) ;
173
+ const paths = extract_paths ( declarator . id ) ;
174
174
175
175
const init = /** @type {CallExpression } */ ( declarator . init ) ;
176
176
@@ -189,10 +189,10 @@ export function VariableDeclaration(node, context) {
189
189
) ;
190
190
}
191
191
192
- for ( let i = 0 ; i < bindings . length ; i ++ ) {
193
- const binding = bindings [ i ] ;
192
+ for ( let i = 0 ; i < paths . length ; i ++ ) {
193
+ const path = paths [ i ] ;
194
194
declarations . push (
195
- b . declarator ( binding . node , b . call ( '$.derived' , b . thunk ( binding . expression ( rhs ) ) ) )
195
+ b . declarator ( path . node , b . call ( '$.derived' , b . thunk ( path . expression ( rhs ) ) ) )
196
196
) ;
197
197
}
198
198
}
0 commit comments