File tree 1 file changed +18
-12
lines changed
crates/spidermonkey-embedding-splicer/src
1 file changed +18
-12
lines changed Original file line number Diff line number Diff line change @@ -525,13 +525,13 @@ impl JsBindgen<'_> {
525
525
fn imports_bindgen ( & mut self , guest_imports : & Vec < String > ) {
526
526
for ( key, impt) in & self . resolve . worlds [ self . world ] . imports {
527
527
let import_name = self . resolve . name_world_key ( key) ;
528
- if !guest_imports. contains ( & import_name)
529
- && !import_name. starts_with ( & self . local_package_name )
530
- {
531
- continue ;
532
- }
533
528
match & impt {
534
529
WorldItem :: Function ( f) => {
530
+ if !guest_imports. contains ( & import_name)
531
+ && !import_name. starts_with ( & self . local_package_name )
532
+ {
533
+ continue ;
534
+ }
535
535
self . import_bindgen ( import_name, f, false , None ) ;
536
536
}
537
537
WorldItem :: Interface {
@@ -577,15 +577,21 @@ impl JsBindgen<'_> {
577
577
uwriteln ! ( self . src, "\n export class import_{name} {{" ) ;
578
578
}
579
579
580
- for ( _, func) in functions {
581
- self . import_bindgen (
582
- import_name. clone ( ) ,
583
- func,
584
- true ,
585
- iface_name. clone ( ) ,
586
- ) ;
580
+ if guest_imports. contains ( & import_name)
581
+ || import_name. starts_with ( & self . local_package_name )
582
+ {
583
+ for ( _, func) in functions {
584
+ self . import_bindgen (
585
+ import_name. clone ( ) ,
586
+ func,
587
+ true ,
588
+ iface_name. clone ( ) ,
589
+ ) ;
590
+ }
587
591
}
588
592
593
+ // TODO: Resource tree-shaking, which requires resource use checks against used
594
+ // functions.
589
595
if let Some ( ty) = resource {
590
596
let lower_camel = & self . resolve . types [ ty]
591
597
. name
You can’t perform that action at this time.
0 commit comments