|
|
@ -42,7 +42,7 @@ export function build_component(node, component_name, context, anchor = context.
|
|
|
|
/** @type {Property[]} */
|
|
|
|
/** @type {Property[]} */
|
|
|
|
const custom_css_props = [];
|
|
|
|
const custom_css_props = [];
|
|
|
|
|
|
|
|
|
|
|
|
/** @type {Identifier | MemberExpression | null} */
|
|
|
|
/** @type {Identifier | MemberExpression | [Expression, Expression] | null} */
|
|
|
|
let bind_this = null;
|
|
|
|
let bind_this = null;
|
|
|
|
|
|
|
|
|
|
|
|
/** @type {ExpressionStatement[]} */
|
|
|
|
/** @type {ExpressionStatement[]} */
|
|
|
@ -162,6 +162,9 @@ export function build_component(node, component_name, context, anchor = context.
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (attribute.type === 'BindDirective') {
|
|
|
|
} else if (attribute.type === 'BindDirective') {
|
|
|
|
if (Array.isArray(attribute.expression)) {
|
|
|
|
if (Array.isArray(attribute.expression)) {
|
|
|
|
|
|
|
|
if (attribute.name === 'this') {
|
|
|
|
|
|
|
|
bind_this = attribute.expression;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
const [get_expression, set_expression] = attribute.expression;
|
|
|
|
const [get_expression, set_expression] = attribute.expression;
|
|
|
|
const get = /** @type {Expression} */ (context.visit(get_expression));
|
|
|
|
const get = /** @type {Expression} */ (context.visit(get_expression));
|
|
|
|
const set = /** @type {Expression} */ (context.visit(set_expression));
|
|
|
|
const set = /** @type {Expression} */ (context.visit(set_expression));
|
|
|
@ -173,6 +176,7 @@ export function build_component(node, component_name, context, anchor = context.
|
|
|
|
|
|
|
|
|
|
|
|
push_prop(b.get(attribute.name, [b.return(b.call(get_id))]));
|
|
|
|
push_prop(b.get(attribute.name, [b.return(b.call(get_id))]));
|
|
|
|
push_prop(b.set(attribute.name, [b.stmt(b.call(set_id, b.id('$$value')))]));
|
|
|
|
push_prop(b.set(attribute.name, [b.stmt(b.call(set_id, b.id('$$value')))]));
|
|
|
|
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
const expression = /** @type {Expression} */ (context.visit(attribute.expression));
|
|
|
|
const expression = /** @type {Expression} */ (context.visit(attribute.expression));
|
|
|
|
|
|
|
|
|
|
|
|