chore: remove unused EACH_KEYED constant (#12814)

pull/12816/head
Rich Harris 1 month ago committed by GitHub
parent 9ba370f305
commit 31a4449012
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -7,8 +7,7 @@ import {
EACH_IS_ANIMATED, EACH_IS_ANIMATED,
EACH_IS_CONTROLLED, EACH_IS_CONTROLLED,
EACH_ITEM_IMMUTABLE, EACH_ITEM_IMMUTABLE,
EACH_ITEM_REACTIVE, EACH_ITEM_REACTIVE
EACH_KEYED
} from '../../../../../constants.js'; } from '../../../../../constants.js';
import { dev } from '../../../../state.js'; import { dev } from '../../../../state.js';
import { extract_paths, object } from '../../../../utils/ast.js'; import { extract_paths, object } from '../../../../utils/ast.js';
@ -42,13 +41,9 @@ export function EachBlock(node, context) {
let flags = 0; let flags = 0;
if (node.metadata.keyed) { if (node.metadata.keyed && node.index) {
flags |= EACH_KEYED;
if (node.index) {
flags |= EACH_INDEX_REACTIVE; flags |= EACH_INDEX_REACTIVE;
} }
}
const key_is_item = const key_is_item =
node.key?.type === 'Identifier' && node.key?.type === 'Identifier' &&
@ -252,7 +247,7 @@ export function EachBlock(node, context) {
declarations.push(b.let(node.index, index)); declarations.push(b.let(node.index, index));
} }
if (dev && (flags & EACH_KEYED) !== 0) { if (dev && node.metadata.keyed) {
context.state.init.push( context.state.init.push(
b.stmt(b.call('$.validate_each_keys', b.thunk(collection), key_function)) b.stmt(b.call('$.validate_each_keys', b.thunk(collection), key_function))
); );

@ -1,11 +1,9 @@
export const EACH_ITEM_REACTIVE = 1; export const EACH_ITEM_REACTIVE = 1;
export const EACH_INDEX_REACTIVE = 1 << 1; export const EACH_INDEX_REACTIVE = 1 << 1;
export const EACH_KEYED = 1 << 2;
/** See EachBlock interface metadata.is_controlled for an explanation what this is */ /** See EachBlock interface metadata.is_controlled for an explanation what this is */
export const EACH_IS_CONTROLLED = 1 << 3; export const EACH_IS_CONTROLLED = 1 << 2;
export const EACH_IS_ANIMATED = 1 << 4; export const EACH_IS_ANIMATED = 1 << 3;
export const EACH_ITEM_IMMUTABLE = 1 << 5; export const EACH_ITEM_IMMUTABLE = 1 << 4;
export const PROPS_IS_IMMUTABLE = 1; export const PROPS_IS_IMMUTABLE = 1;
export const PROPS_IS_RUNES = 1 << 1; export const PROPS_IS_RUNES = 1 << 1;

Loading…
Cancel
Save