@@ -2074,12 +2074,16 @@ function flushCompletedQueues(
2074
2074
const completedRootSegment = request . completedRootSegment ;
2075
2075
if ( completedRootSegment !== null ) {
2076
2076
if ( request . pendingRootTasks === 0 ) {
2077
- const preamble = request . preamble ;
2078
- for ( i = 0 ; i < preamble . length ; i ++ ) {
2079
- // we expect the preamble to be tiny and will ignore backpressure
2080
- writeChunk ( destination , preamble [ i ] ) ;
2077
+ if ( enableFloat ) {
2078
+ const preamble : Array <
2079
+ Chunk | PrecomputedChunk ,
2080
+ > = ( request . preamble : any ) ;
2081
+ for ( i = 0 ; i < preamble . length ; i ++ ) {
2082
+ // we expect the preamble to be tiny and will ignore backpressure
2083
+ writeChunk ( destination , preamble [ i ] ) ;
2084
+ }
2085
+ preamble . length = 0 ;
2081
2086
}
2082
- preamble . length = 0 ;
2083
2087
2084
2088
flushSegment ( request , destination , completedRootSegment ) ;
2085
2089
request . completedRootSegment = null ;
@@ -2165,11 +2169,15 @@ function flushCompletedQueues(
2165
2169
// either they have pending task or they're complete.
2166
2170
) {
2167
2171
allComplete = true ;
2168
- const postamble = request . postamble ;
2169
- for ( i = 0 ; i < postamble . length ; i ++ ) {
2170
- writeChunk ( destination , postamble [ i ] ) ;
2172
+ if ( enableFloat ) {
2173
+ const postamble : Array <
2174
+ Chunk | PrecomputedChunk ,
2175
+ > = ( request . postamble : any ) ;
2176
+ for ( i = 0 ; i < postamble . length ; i ++ ) {
2177
+ writeChunk ( destination , postamble [ i ] ) ;
2178
+ }
2179
+ postamble . length = 0 ;
2171
2180
}
2172
- postamble . length = 0 ;
2173
2181
}
2174
2182
} finally {
2175
2183
completeWriting ( destination ) ;
0 commit comments