@@ -197,14 +197,16 @@ export function emitWebIdl(
197
197
( i ) => getExtendList ( i . name ) . concat ( getImplementList ( i . name ) ) ,
198
198
) ;
199
199
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
+ }
205
207
iNameToIDependList [ i . name ] . forEach ( ( name ) => {
206
208
name = name . replace ( / < .* > $ / , "" ) ;
207
- ( result [ name ] ??= [ ] ) . push ( i . name ) ;
209
+ result [ name ] = true ;
208
210
} ) ;
209
211
return result ;
210
212
} ,
@@ -1526,6 +1528,7 @@ export function emitWebIdl(
1526
1528
name : i . name ,
1527
1529
extends : i . forwardExtends ,
1528
1530
constructor : undefined ,
1531
+ noToStringTag : true ,
1529
1532
} ) ;
1530
1533
}
1531
1534
@@ -1653,7 +1656,7 @@ export function emitWebIdl(
1653
1656
return ;
1654
1657
}
1655
1658
// 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 ] ) {
1657
1660
return ;
1658
1661
}
1659
1662
printer . printLine (
0 commit comments