File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,6 @@ function Response(nativeResponse) {
100100  this . url  =  nativeResponse . url ; 
101101
102102  this . _response  =  nativeResponse ; 
103-   this . _blob  =  null ; 
104103  this . _json  =  null ; 
105104  this . _text  =  null ; 
106105
@@ -151,12 +150,22 @@ Response.prototype = {
151150    throw  new  Error ( 'Not implemented.' ) ; 
152151  } , 
153152  json ( )  { 
153+     if  ( this . _json  !==  null )  { 
154+       return  this . _json ; 
155+     } 
154156    const  buffer  =  readResult ( this . _result ) ; 
155-     return  JSON . parse ( buffer . toString ( ) ) ; 
157+     const  json  =  JSON . parse ( buffer . toString ( ) ) ; 
158+     this . _json  =  json ; 
159+     return  json ; 
156160  } , 
157161  text ( )  { 
162+     if  ( this . _text  !==  null )  { 
163+       return  this . _text ; 
164+     } 
158165    const  buffer  =  readResult ( this . _result ) ; 
159-     return  buffer . toString ( ) ; 
166+     const  text  =  buffer . toString ( ) ; 
167+     this . _text  =  text ; 
168+     return  text ; 
160169  } , 
161170} ; 
162171
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments