@@ -197,14 +197,16 @@ export function emitWebIdl(
197197 ( i ) => getExtendList ( i . name ) . concat ( getImplementList ( i . name ) ) ,
198198 ) ;
199199
200- /// Reverse map of interfaces to those that inherit from it
201- /// e.g. If i1 depends on i2, i1 should be in childrenMap.[i2.Name]
202- const iNameToIChildrenList = allNonCallbackInterfaces . reduce (
203- ( result , i ) : Record < string , string [ ] > => {
204- result [ i . name ] ??= [ ] ;
200+ /// Interface name mapped to whether that interface is an inheritance target
201+ const iNameIsInheritanceTarget = allNonCallbackInterfaces . reduce (
202+ ( result , i ) : Record < string , boolean > => {
203+ result [ i . name ] ??= false ;
204+ if ( i . forwardExtends ) {
205+ result [ i . forwardExtends ] = true ;
206+ }
205207 iNameToIDependList [ i . name ] . forEach ( ( name ) => {
206208 name = name . replace ( / < .* > $ / , "" ) ;
207- ( result [ name ] ??= [ ] ) . push ( i . name ) ;
209+ result [ name ] = true ;
208210 } ) ;
209211 return result ;
210212 } ,
@@ -1526,6 +1528,7 @@ export function emitWebIdl(
15261528 name : i . name ,
15271529 extends : i . forwardExtends ,
15281530 constructor : undefined ,
1531+ noToStringTag : true ,
15291532 } ) ;
15301533 }
15311534
@@ -1653,7 +1656,7 @@ export function emitWebIdl(
16531656 return ;
16541657 }
16551658 // Do not emit toString tag if interface is an inheritance target of other interfaces
1656- if ( iNameToIChildrenList [ i . name ] . length ) {
1659+ if ( iNameIsInheritanceTarget [ i . name ] ) {
16571660 return ;
16581661 }
16591662 printer . printLine (
0 commit comments