File tree Expand file tree Collapse file tree 2 files changed +7
-14
lines changed
compiler/phases/3-transform/client/visitors Expand file tree Collapse file tree 2 files changed +7
-14
lines changed Original file line number Diff line number Diff line change 7
7
EACH_IS_ANIMATED ,
8
8
EACH_IS_CONTROLLED ,
9
9
EACH_ITEM_IMMUTABLE ,
10
- EACH_ITEM_REACTIVE ,
11
- EACH_KEYED
10
+ EACH_ITEM_REACTIVE
12
11
} from '../../../../../constants.js' ;
13
12
import { dev } from '../../../../state.js' ;
14
13
import { extract_paths , object } from '../../../../utils/ast.js' ;
@@ -42,12 +41,8 @@ export function EachBlock(node, context) {
42
41
43
42
let flags = 0 ;
44
43
45
- if ( node . metadata . keyed ) {
46
- flags |= EACH_KEYED ;
47
-
48
- if ( node . index ) {
49
- flags |= EACH_INDEX_REACTIVE ;
50
- }
44
+ if ( node . metadata . keyed && node . index ) {
45
+ flags |= EACH_INDEX_REACTIVE ;
51
46
}
52
47
53
48
const key_is_item =
@@ -252,7 +247,7 @@ export function EachBlock(node, context) {
252
247
declarations . push ( b . let ( node . index , index ) ) ;
253
248
}
254
249
255
- if ( dev && ( flags & EACH_KEYED ) !== 0 ) {
250
+ if ( dev && node . metadata . keyed ) {
256
251
context . state . init . push (
257
252
b . stmt ( b . call ( '$.validate_each_keys' , b . thunk ( collection ) , key_function ) )
258
253
) ;
Original file line number Diff line number Diff line change 1
1
export const EACH_ITEM_REACTIVE = 1 ;
2
2
export const EACH_INDEX_REACTIVE = 1 << 1 ;
3
- export const EACH_KEYED = 1 << 2 ;
4
-
5
3
/** See EachBlock interface metadata.is_controlled for an explanation what this is */
6
- export const EACH_IS_CONTROLLED = 1 << 3 ;
7
- export const EACH_IS_ANIMATED = 1 << 4 ;
8
- export const EACH_ITEM_IMMUTABLE = 1 << 5 ;
4
+ export const EACH_IS_CONTROLLED = 1 << 2 ;
5
+ export const EACH_IS_ANIMATED = 1 << 3 ;
6
+ export const EACH_ITEM_IMMUTABLE = 1 << 4 ;
9
7
10
8
export const PROPS_IS_IMMUTABLE = 1 ;
11
9
export const PROPS_IS_RUNES = 1 << 1 ;
You can’t perform that action at this time.
0 commit comments