@@ -82,11 +82,9 @@ function createTextWriter(newLine: string) {
82
82
stack = [ ] ;
83
83
}
84
84
85
- function writeLine ( ) {
86
- if ( ! lineStart ) {
87
- output += newLine ;
88
- lineStart = true ;
89
- }
85
+ function endLine ( ) {
86
+ output += newLine ;
87
+ lineStart = true ;
90
88
}
91
89
92
90
reset ( ) ;
@@ -98,8 +96,9 @@ function createTextWriter(newLine: string) {
98
96
increaseIndent ( ) { indent ++ ; } ,
99
97
decreaseIndent ( ) { indent -- ; } ,
100
98
99
+ endLine : endLine ,
101
100
print : write ,
102
- printLine ( c : string ) { writeLine ( ) ; write ( c ) ; } ,
101
+ printLine ( c : string ) { write ( c ) ; endLine ( ) ; } ,
103
102
104
103
clearStack ( ) { stack = [ ] ; } ,
105
104
stackIsEmpty ( ) { return stack . length === 0 ; } ,
@@ -825,7 +824,7 @@ export function emitWebIDl(webidl: Browser.WebIdl, flavor: Flavor) {
825
824
printer . printLineToStack ( `interface ${ processInterfaceType ( i , i . name ) } extends ${ processedIName } {` ) ;
826
825
}
827
826
828
- printer . printLine ( `interface ${ processInterfaceType ( i , processedIName ) } ` ) ;
827
+ printer . print ( `interface ${ processInterfaceType ( i , processedIName ) } ` ) ;
829
828
830
829
const finalExtends = distinct ( [ i . extends || "Object" ] . concat ( i . implements || [ ] )
831
830
. filter ( i => i !== "Object" )
@@ -835,6 +834,7 @@ export function emitWebIDl(webidl: Browser.WebIdl, flavor: Flavor) {
835
834
printer . print ( ` extends ${ finalExtends . join ( ", " ) } ` ) ;
836
835
}
837
836
printer . print ( " {" ) ;
837
+ printer . endLine ( ) ;
838
838
}
839
839
840
840
/// To decide if a given method is an indexer and should be emited
@@ -895,12 +895,13 @@ export function emitWebIDl(webidl: Browser.WebIdl, flavor: Flavor) {
895
895
const ehParentCount = iNameToEhParents [ i . name ] && iNameToEhParents [ i . name ] . length ;
896
896
897
897
if ( hasEventHandlers || ehParentCount > 1 ) {
898
- printer . printLine ( `interface ${ i . name } EventMap` ) ;
898
+ printer . print ( `interface ${ i . name } EventMap` ) ;
899
899
if ( ehParentCount ) {
900
900
const extend = iNameToEhParents [ i . name ] . map ( i => i . name + "EventMap" ) ;
901
901
printer . print ( ` extends ${ extend . join ( ", " ) } ` ) ;
902
902
}
903
903
printer . print ( " {" ) ;
904
+ printer . endLine ( ) ;
904
905
printer . increaseIndent ( ) ;
905
906
iNameToEhList [ i . name ]
906
907
. sort ( compareName )
@@ -1184,6 +1185,7 @@ export function emitWebIDl(webidl: Browser.WebIdl, flavor: Flavor) {
1184
1185
if ( subtypes ) {
1185
1186
const iteratorExtends = getIteratorExtends ( i . iterator , subtypes ) ;
1186
1187
const name = extendConflictsBaseTypes [ i . name ] ? `${ i . name } Base` : i . name ;
1188
+ printer . printLine ( "" ) ;
1187
1189
printer . printLine ( `interface ${ name } ${ iteratorExtends } {` ) ;
1188
1190
printer . increaseIndent ( ) ;
1189
1191
if ( ! iteratorExtends ) {
@@ -1194,7 +1196,6 @@ export function emitWebIDl(webidl: Browser.WebIdl, flavor: Flavor) {
1194
1196
}
1195
1197
printer . decreaseIndent ( ) ;
1196
1198
printer . printLine ( "}" ) ;
1197
- printer . printLine ( "" ) ;
1198
1199
}
1199
1200
}
1200
1201
@@ -1203,7 +1204,6 @@ export function emitWebIDl(webidl: Browser.WebIdl, flavor: Flavor) {
1203
1204
printer . printLine ( "/////////////////////////////" ) ;
1204
1205
printer . printLine ( "/// DOM Iterable APIs" ) ;
1205
1206
printer . printLine ( "/////////////////////////////" ) ;
1206
- printer . printLine ( "" ) ;
1207
1207
1208
1208
allInterfaces
1209
1209
. sort ( compareName )
0 commit comments