pull/16444/head
Rich Harris 2 months ago
parent ed237a69ee
commit 64e4a4bd2a

@ -271,21 +271,14 @@ export function VariableDeclaration(node, context) {
context.state.transform[id.name] = { read: get_value }; context.state.transform[id.name] = { read: get_value };
const expression = /** @type {Expression} */ (context.visit(b.thunk(value))); const expression = /** @type {Expression} */ (context.visit(b.thunk(value)));
const call = b.call('$.derived', expression); let call = b.call('$.derived', expression);
declarations.push(
b.declarator( if (dev) {
id, const label = `[$derived ${declarator.id.type === 'ArrayPattern' ? 'iterable' : 'object'}]`;
dev call = b.call('$.tag', call, b.literal(label));
? b.call( }
'$.tag',
call, declarations.push(b.declarator(id, call));
b.literal(
`[$derived ${declarator.id.type === 'ArrayPattern' ? 'iterable' : 'object'}]`
)
)
: call
)
);
} }
for (const path of paths) { for (const path of paths) {

Loading…
Cancel
Save