@@ -223,7 +223,7 @@ export default function dom(
223223
224224 component . rewrite_props ( ( { name, reassigned, export_name } ) => {
225225 const value = `$${ name } ` ;
226-
226+
227227 const insert = ( reassigned || export_name )
228228 ? b `${ `$$subscribe_${ name } ` } ()`
229229 : b `@component_subscribe($$self, ${ name } , #value => $$invalidate('${ value } ', ${ value } = #value))` ;
@@ -426,10 +426,14 @@ export default function dom(
426426 }
427427
428428 const prop_names = x `[]` ;
429+ const renamed_prop_names = [ ] ;
429430
430431 // TODO find a more idiomatic way of doing this
431432 props . forEach ( v => {
432433 ( prop_names as any ) . elements . push ( { type : 'Literal' , value : v . export_name } ) ;
434+ if ( v . name !== v . export_name ) {
435+ renamed_prop_names . push ( p `${ v . export_name } : "${ v . name } "` ) ;
436+ }
433437 } ) ;
434438
435439 if ( options . customElement ) {
@@ -440,7 +444,7 @@ export default function dom(
440444
441445 ${ css . code && b `this.shadowRoot.innerHTML = \`<style>${ css . code . replace ( / \\ / g, '\\\\' ) } ${ options . dev ? `\n/*# sourceMappingURL=${ css . map . toUrl ( ) } */` : '' } </style>\`;` }
442446
443- @init(this, { target: this.shadowRoot }, ${ definition } , create_fragment, ${ not_equal } , ${ prop_names } );
447+ @init(this, { target: this.shadowRoot }, ${ definition } , create_fragment, ${ not_equal } , ${ prop_names } , ${ renamed_prop_names . length > 0 && x `{ ${ renamed_prop_names } }` } );
444448
445449 ${ dev_props_check }
446450
@@ -492,7 +496,7 @@ export default function dom(
492496 constructor(options) {
493497 super(${ options . dev && `options` } );
494498 ${ should_add_css && b `if (!@_document.getElementById("${ component . stylesheet . id } -style")) ${ add_css } ();` }
495- @init(this, options, ${ definition } , create_fragment, ${ not_equal } , ${ prop_names } );
499+ @init(this, options, ${ definition } , create_fragment, ${ not_equal } , ${ prop_names } , ${ renamed_prop_names . length > 0 && x `{ ${ renamed_prop_names } }` } );
496500 ${ options . dev && b `@dispatch_dev("SvelteRegisterComponent", { component: this, tagName: "${ name . name } ", options, id: create_fragment.name });` }
497501
498502 ${ dev_props_check }
0 commit comments