|
|
|
@ -798,7 +798,9 @@ function serialize_inline_component(node, component_name, context) {
|
|
|
|
|
const assignment = b.assignment('=', attribute.expression, b.id('$$value'));
|
|
|
|
|
push_prop(
|
|
|
|
|
b.set(attribute.name, [
|
|
|
|
|
b.stmt(serialize_set_binding(assignment, context, () => context.visit(assignment)))
|
|
|
|
|
b.stmt(
|
|
|
|
|
serialize_set_binding(assignment, context, () => context.visit(assignment), false)
|
|
|
|
|
)
|
|
|
|
|
])
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
@ -1026,7 +1028,7 @@ function serialize_bind_this(bind_this, context, node) {
|
|
|
|
|
const bind_this_id = /** @type {import('estree').Expression} */ (context.visit(bind_this));
|
|
|
|
|
const ids = Array.from(each_ids.values()).map((id) => b.id('$$value_' + id[0]));
|
|
|
|
|
const assignment = b.assignment('=', bind_this, b.id('$$value'));
|
|
|
|
|
const update = serialize_set_binding(assignment, context, () => context.visit(assignment));
|
|
|
|
|
const update = serialize_set_binding(assignment, context, () => context.visit(assignment), false);
|
|
|
|
|
|
|
|
|
|
for (const [binding, [, , expression]] of each_ids) {
|
|
|
|
|
// reset expressions to what they were before
|
|
|
|
@ -2400,7 +2402,7 @@ export const template_visitors = {
|
|
|
|
|
if (assignment.left.type !== 'Identifier' && assignment.left.type !== 'MemberExpression') {
|
|
|
|
|
// serialize_set_binding turns other patterns into IIFEs and separates the assignments
|
|
|
|
|
// into separate expressions, at which point this is called again with an identifier or member expression
|
|
|
|
|
return serialize_set_binding(assignment, context, () => assignment);
|
|
|
|
|
return serialize_set_binding(assignment, context, () => assignment, false);
|
|
|
|
|
}
|
|
|
|
|
const left = object(assignment.left);
|
|
|
|
|
const value = get_assignment_value(assignment, context);
|
|
|
|
@ -2438,7 +2440,7 @@ export const template_visitors = {
|
|
|
|
|
: b.id(node.index);
|
|
|
|
|
const item = each_node_meta.item;
|
|
|
|
|
const binding = /** @type {import('#compiler').Binding} */ (context.state.scope.get(item.name));
|
|
|
|
|
binding.expression = (id) => {
|
|
|
|
|
binding.expression = (/** @type {import("estree").Identifier} */ id) => {
|
|
|
|
|
const item_with_loc = with_loc(item, id);
|
|
|
|
|
return b.call('$.unwrap', item_with_loc);
|
|
|
|
|
};
|
|
|
|
@ -2762,6 +2764,7 @@ export const template_visitors = {
|
|
|
|
|
assignment,
|
|
|
|
|
context,
|
|
|
|
|
() => /** @type {import('estree').Expression} */ (visit(assignment)),
|
|
|
|
|
false,
|
|
|
|
|
{
|
|
|
|
|
skip_proxy_and_freeze: true
|
|
|
|
|
}
|
|
|
|
|