revert some stuff for now

aaa
Rich Harris 8 months ago
parent b386784d97
commit beaa64f0de

@ -648,9 +648,6 @@ function build_custom_element_attribute_update_assignment(node_id, attribute, co
state.init.push(b.stmt(b.call('$.template_effect', b.thunk(update.expression)))); state.init.push(b.stmt(b.call('$.template_effect', b.thunk(update.expression))));
return true; return true;
} else { } else {
if (attribute.metadata.expression.is_async) {
throw new Error('TODO top-level await');
}
state.init.push(update); state.init.push(update);
return false; return false;
} }

@ -172,17 +172,8 @@ export function build_component(node, component_name, context, anchor = context.
if (should_wrap_in_derived) { if (should_wrap_in_derived) {
const id = b.id(context.state.scope.generate(attribute.name)); const id = b.id(context.state.scope.generate(attribute.name));
if (attribute.metadata.expression.is_async) { context.state.init.push(b.var(id, create_derived(context.state, b.thunk(value))));
context.state.metadata.async.push({ arg = b.call('$.get', id);
id,
expression: arg
});
arg = b.call(id);
} else {
context.state.init.push(b.var(id, create_derived(context.state, b.thunk(value))));
arg = b.call('$.get', id);
}
} }
push_prop(b.get(attribute.name, [b.return(arg)])); push_prop(b.get(attribute.name, [b.return(arg)]));

Loading…
Cancel
Save