Rich Harris 8 months ago
parent 1320130862
commit 1588464d3f

@ -64,6 +64,7 @@ export function Attribute(node, context) {
node.metadata.expression.has_state ||= chunk.metadata.expression.has_state;
node.metadata.expression.has_call ||= chunk.metadata.expression.has_call;
node.metadata.expression.is_async ||= chunk.metadata.expression.is_async;
}
if (is_event_attribute(node)) {

@ -32,6 +32,7 @@ export function StyleDirective(node, context) {
node.metadata.expression.has_state ||= chunk.metadata.expression.has_state;
node.metadata.expression.has_call ||= chunk.metadata.expression.has_call;
node.metadata.expression.is_async ||= chunk.metadata.expression.is_async;
}
}
}

@ -94,6 +94,10 @@ export function build_component(node, component_name, context, anchor = context.
}
for (const attribute of node.attributes) {
if (attribute.type === 'Attribute' || attribute.type === 'SpreadAttribute') {
context.state.metadata.init_is_async ||= attribute.metadata.expression.is_async;
}
if (attribute.type === 'LetDirective') {
if (!slot_scope_applies_to_itself) {
lets.push(/** @type {ExpressionStatement} */ (context.visit(attribute, states.default)));

Loading…
Cancel
Save