File tree Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -320,12 +320,6 @@ function cloneBody (body) {
320320  } 
321321} 
322322
323- function  throwIfAborted  ( state )  { 
324-   if  ( state . aborted )  { 
325-     throw  new  DOMException ( 'The operation was aborted.' ,  'AbortError' ) 
326-   } 
327- } 
328- 
329323function  bodyMixinMethods  ( instance ,  getInternalState )  { 
330324  const  methods  =  { 
331325    blob  ( )  { 
@@ -443,19 +437,21 @@ function mixinBody (prototype, getInternalState) {
443437 * @param  {any } instance 
444438 * @param  {(target: any) => any } getInternalState 
445439 */ 
446- async   function  consumeBody  ( object ,  convertBytesToJSValue ,  instance ,  getInternalState )  { 
440+ function  consumeBody  ( object ,  convertBytesToJSValue ,  instance ,  getInternalState )  { 
447441  webidl . brandCheck ( object ,  instance ) 
448442
449443  const  state  =  getInternalState ( object ) 
450444
445+   if  ( state . aborted )  { 
446+     return  Promise . reject ( new  DOMException ( 'The operation was aborted.' ,  'AbortError' ) ) 
447+   } 
448+ 
451449  // 1. If object is unusable, then return a promise rejected 
452450  //    with a TypeError. 
453451  if  ( bodyUnusable ( state ) )  { 
454-     throw   new  TypeError ( 'Body is unusable: Body has already been read' ) 
452+     return   Promise . reject ( new  TypeError ( 'Body is unusable: Body has already been read' ) ) 
455453  } 
456454
457-   throwIfAborted ( state ) 
458- 
459455  // 2. Let promise be a new promise. 
460456  const  promise  =  createDeferredPromise ( ) 
461457
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments