@@ -223,7 +223,7 @@ export default function dom(
223
223
224
224
component . rewrite_props ( ( { name, reassigned, export_name } ) => {
225
225
const value = `$${ name } ` ;
226
-
226
+
227
227
const insert = ( reassigned || export_name )
228
228
? b `${ `$$subscribe_${ name } ` } ()`
229
229
: b `@component_subscribe($$self, ${ name } , #value => $$invalidate('${ value } ', ${ value } = #value))` ;
@@ -426,10 +426,14 @@ export default function dom(
426
426
}
427
427
428
428
const prop_names = x `[]` ;
429
+ const renamed_prop_names = [ ] ;
429
430
430
431
// TODO find a more idiomatic way of doing this
431
432
props . forEach ( v => {
432
433
( 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
+ }
433
437
} ) ;
434
438
435
439
if ( options . customElement ) {
@@ -440,7 +444,7 @@ export default function dom(
440
444
441
445
${ css . code && b `this.shadowRoot.innerHTML = \`<style>${ css . code . replace ( / \\ / g, '\\\\' ) } ${ options . dev ? `\n/*# sourceMappingURL=${ css . map . toUrl ( ) } */` : '' } </style>\`;` }
442
446
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 } }` } );
444
448
445
449
${ dev_props_check }
446
450
@@ -492,7 +496,7 @@ export default function dom(
492
496
constructor(options) {
493
497
super(${ options . dev && `options` } );
494
498
${ 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 } }` } );
496
500
${ options . dev && b `@dispatch_dev("SvelteRegisterComponent", { component: this, tagName: "${ name . name } ", options, id: create_fragment.name });` }
497
501
498
502
${ dev_props_check }
0 commit comments