File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
packages/svelte/src/compiler/phases/3-transform/server/visitors/shared Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -163,13 +163,26 @@ export function build_element_attributes(node, context) {
163163 ] )
164164 ) ;
165165 } else {
166+ /** @type {Expression } */
167+ let expression = attribute . expression ;
168+
169+ if ( attribute . type === 'BindDirective' && expression . type === 'SequenceExpression' ) {
170+ const getter = expression . expressions [ 0 ] ;
171+ expression =
172+ getter . type === 'ArrowFunctionExpression' &&
173+ getter . params . length === 0 &&
174+ getter . body . type !== 'BlockStatement'
175+ ? getter . body
176+ : b . call ( getter ) ;
177+ }
178+
166179 attributes . push (
167180 create_attribute ( attribute . name , - 1 , - 1 , [
168181 {
169182 type : 'ExpressionTag' ,
170183 start : - 1 ,
171184 end : - 1 ,
172- expression : attribute . expression ,
185+ expression,
173186 metadata : {
174187 expression : create_expression_metadata ( )
175188 }
You can’t perform that action at this time.
0 commit comments