pull/15844/head
Rich Harris 3 months ago
parent 1e2e57ff51
commit a01249ee21

@ -475,19 +475,19 @@ export function build_class_directives_object(
) { ) {
let properties = []; let properties = [];
let has_call_or_state = false; let has_call_or_state = false;
let has_async = false; let has_await = false;
for (const d of class_directives) { for (const d of class_directives) {
const expression = /** @type Expression */ (context.visit(d.expression)); const expression = /** @type Expression */ (context.visit(d.expression));
properties.push(b.init(d.name, expression)); properties.push(b.init(d.name, expression));
has_call_or_state ||= d.metadata.expression.has_call || d.metadata.expression.has_state; has_call_or_state ||= d.metadata.expression.has_call || d.metadata.expression.has_state;
has_async ||= d.metadata.expression.has_await; has_await ||= d.metadata.expression.has_await;
} }
const directives = b.object(properties); const directives = b.object(properties);
return has_call_or_state || has_async return has_call_or_state || has_await
? get_expression_id(has_async ? async_expressions : expressions, directives) ? get_expression_id(has_await ? async_expressions : expressions, directives)
: directives; : directives;
} }

Loading…
Cancel
Save