@@ -350,11 +350,6 @@ export function emitWebIdl(webidl: Browser.WebIdl, flavor: Flavor) {
350
350
}
351
351
}
352
352
353
- function convertDomTypeToNullableTsType ( obj : Browser . Typed ) {
354
- const resolvedType = convertDomTypeToTsType ( obj ) ;
355
- return obj . nullable ? makeNullable ( resolvedType ) : resolvedType ;
356
- }
357
-
358
353
function nameWithForwardedTypes ( i : Browser . Interface ) {
359
354
const typeParameters = i [ "type-parameters" ] ;
360
355
@@ -383,7 +378,7 @@ export function emitWebIdl(webidl: Browser.WebIdl, flavor: Flavor) {
383
378
384
379
return expectedMName === m . name &&
385
380
m . signature && m . signature . length === 1 &&
386
- convertDomTypeToNullableTsType ( m . signature [ 0 ] ) === expectedMType &&
381
+ convertDomTypeToTsType ( m . signature [ 0 ] ) === expectedMType &&
387
382
m . signature [ 0 ] . param && m . signature [ 0 ] . param ! . length === expectedParamType . length &&
388
383
expectedParamType . every ( ( pt , idx ) => convertDomTypeToTsType ( m . signature [ 0 ] . param ! [ idx ] ) === pt ) ;
389
384
}
@@ -501,7 +496,7 @@ export function emitWebIdl(webidl: Browser.WebIdl, flavor: Flavor) {
501
496
p = { name : p . name , type : [ p . subtype ! , p ] }
502
497
}
503
498
const isOptional = ! p . variadic && p . optional ;
504
- const pType = isOptional ? convertDomTypeToTsType ( p ) : convertDomTypeToNullableTsType ( p ) ;
499
+ const pType = convertDomTypeToTsType ( p ) ;
505
500
const variadicParams = p . variadic && pType . indexOf ( '|' ) !== - 1 ;
506
501
return ( p . variadic ? "..." : "" ) +
507
502
adjustParamName ( p . name ) +
@@ -534,7 +529,7 @@ export function emitWebIdl(webidl: Browser.WebIdl, flavor: Flavor) {
534
529
function emitCallBackFunction ( cb : Browser . CallbackFunction ) {
535
530
printer . printLine ( `interface ${ processInterfaceType ( cb , cb . name ) } {` ) ;
536
531
printer . increaseIndent ( ) ;
537
- emitSignatures ( cb , "" , "" , s => printer . printLine ( s ) ) ;
532
+ emitSignatures ( cb , "" , "" , printer . printLine ) ;
538
533
printer . decreaseIndent ( ) ;
539
534
printer . printLine ( "}" ) ;
540
535
printer . printLine ( "" ) ;
@@ -761,8 +756,8 @@ export function emitWebIdl(webidl: Browser.WebIdl, flavor: Flavor) {
761
756
762
757
// Emit constructor signature
763
758
if ( constructor ) {
764
- emitComments ( constructor , s => printer . print ( s ) ) ;
765
- emitSignatures ( constructor , "" , "new" , s => printer . printLine ( s ) ) ;
759
+ emitComments ( constructor , printer . print ) ;
760
+ emitSignatures ( constructor , "" , "new" , printer . printLine ) ;
766
761
}
767
762
else {
768
763
printer . printLine ( `new(): ${ i . name } ;` ) ;
0 commit comments