pull/15820/head
Rich Harris 4 months ago
parent 855f209e8e
commit d31831be16

@ -70,11 +70,7 @@ export function ClassBody(node, context) {
if (name[0] === '#') {
body.push(/** @type {PropertyDefinition} */ (context.visit(definition, child_state)));
} else {
if (field.node.type === 'AssignmentExpression') {
continue;
}
} else if (field.node === definition) {
const member = b.member(b.this, field.key);
const should_proxy = field.type === '$state' && true; // TODO
@ -82,9 +78,7 @@ export function ClassBody(node, context) {
body.push(
b.prop_def(
field.key,
/** @type {CallExpression} */ (
context.visit(definition.value ?? field.value, child_state)
)
/** @type {CallExpression} */ (context.visit(field.value, child_state))
),
b.method('get', definition.key, [], [b.return(b.call('$.get', member))]),

@ -61,19 +61,13 @@ export function ClassBody(node, context) {
if (name[0] === '#' || field.type === '$state' || field.type === '$state.raw') {
body.push(/** @type {PropertyDefinition} */ (context.visit(definition, child_state)));
} else {
if (field.node.type === 'AssignmentExpression') {
continue;
}
} else if (field.node === definition) {
const member = b.member(b.this, field.key);
body.push(
b.prop_def(
field.key,
/** @type {CallExpression} */ (
context.visit(definition.value ?? field.value, child_state)
)
/** @type {CallExpression} */ (context.visit(field.value, child_state))
),
b.method('get', definition.key, [], [b.return(b.call(member))])

Loading…
Cancel
Save