| | | |
Offset 173, 23 lines modified | Offset 173, 15 lines modified |
| |
173 | var·inherits_browserExports·=·inherits_browser.exports; | 173 | var·inherits_browserExports·=·inherits_browser.exports; |
| |
174 | var·readableBrowser·=·{ | 174 | var·readableBrowser·=·{ |
175 | ····exports:·{} | 175 | ····exports:·{} |
176 | }; | 176 | }; |
| |
177 | var·streamBrowser; | |
178 | var·hasRequiredStreamBrowser; | |
| |
179 | function·requireStreamBrowser()·{ | |
180 | ····if·(hasRequiredStreamBrowser)·return·streamBrowser; | |
181 | ····hasRequiredStreamBrowser·=·1; | |
182 | ····streamBrowser·=·require$$0$2.EventEmitter; | 177 | var·streamBrowser·=·require$$0$2.EventEmitter; |
183 | ····return·streamBrowser; | |
184 | } | |
| |
185 | var·buffer_list; | 178 | var·buffer_list; |
186 | var·hasRequiredBuffer_list; | 179 | var·hasRequiredBuffer_list; |
| |
187 | function·requireBuffer_list()·{ | 180 | function·requireBuffer_list()·{ |
188 | ····if·(hasRequiredBuffer_list)·return·buffer_list; | 181 | ····if·(hasRequiredBuffer_list)·return·buffer_list; |
189 | ····hasRequiredBuffer_list·=·1; | 182 | ····hasRequiredBuffer_list·=·1; |
Offset 460, 128 lines modified | Offset 452, 119 lines modified |
460 | ············}]); | 452 | ············}]); |
| |
461 | ············return·BufferList; | 453 | ············return·BufferList; |
462 | ········}(); | 454 | ········}(); |
463 | ····return·buffer_list; | 455 | ····return·buffer_list; |
464 | } | 456 | } |
| |
465 | var·destroy_1; | |
466 | var·hasRequiredDestroy; | 457 | function·destroy(err,·cb)·{ |
| 458 | ····var·_this·=·this; |
| |
| 459 | ····var·readableDestroyed·=·this._readableState·&&·this._readableState.destroyed; |
| 460 | ····var·writableDestroyed·=·this._writableState·&&·this._writableState.destroyed; |
467 | function·requireDestroy()·{ | |
468 | ····if·(hasRequiredDestroy)·return·destroy_1; | |
469 | ····hasRequiredDestroy·=·1; | |
| |
470 | ····function·destroy(err,·cb)·{ | |
471 | ········var·_this·=·this; | |
| |
472 | ········var·readableDestroyed·=·this._readableState·&&·this._readableState.destroyed; | |
473 | ········var·writableDestroyed·=·this._writableState·&&·this._writableState.destroyed; | |
| |
474 | ········if·(readableDestroyed·||·writableDestroyed)·{ | 461 | ····if·(readableDestroyed·||·writableDestroyed)·{ |
475 | ············if·(cb)·{ | 462 | ········if·(cb)·{ |
476 | ················cb(err); | 463 | ············cb(err); |
477 | ············}·else·if·(err)·{ | 464 | ········}·else·if·(err)·{ |
478 | ················if·(!this._writableState)·{ | 465 | ············if·(!this._writableState)·{ |
479 | ····················process.nextTick(emitErrorNT,·this,·err); | 466 | ················process.nextTick(emitErrorNT,·this,·err); |
480 | ················}·else·if·(!this._writableState.errorEmitted)·{ | 467 | ············}·else·if·(!this._writableState.errorEmitted)·{ |
481 | ····················this._writableState.errorEmitted·=·true; | 468 | ················this._writableState.errorEmitted·=·true; |
482 | ····················process.nextTick(emitErrorNT,·this,·err); | 469 | ················process.nextTick(emitErrorNT,·this,·err); |
483 | ················} | |
484 | ············} | 470 | ············} |
| 471 | ········} |
| |
485 | ············return·this; | 472 | ········return·this; |
486 | ········}·//·we·set·destroyed·to·true·before·firing·error·callbacks·in·order | 473 | ····}·//·we·set·destroyed·to·true·before·firing·error·callbacks·in·order |
487 | ········//·to·make·it·re-entrance·safe·in·case·destroy()·is·called·within·callbacks | 474 | ····//·to·make·it·re-entrance·safe·in·case·destroy()·is·called·within·callbacks |
| |
| |
488 | ········if·(this._readableState)·{ | 475 | ····if·(this._readableState)·{ |
489 | ············this._readableState.destroyed·=·true; | 476 | ········this._readableState.destroyed·=·true; |
490 | ········}·//·if·this·is·a·duplex·stream·mark·the·writable·part·as·destroyed·as·well | 477 | ····}·//·if·this·is·a·duplex·stream·mark·the·writable·part·as·destroyed·as·well |
| |
| |
491 | ········if·(this._writableState)·{ | 478 | ····if·(this._writableState)·{ |
492 | ············this._writableState.destroyed·=·true; | 479 | ········this._writableState.destroyed·=·true; |
493 | ········} | 480 | ····} |
| |
494 | ········this._destroy(err·||·null,·function(err)·{ | 481 | ····this._destroy(err·||·null,·function(err)·{ |
495 | ············if·(!cb·&&·err)·{ | 482 | ········if·(!cb·&&·err)·{ |
496 | ················if·(!_this._writableState)·{ | 483 | ············if·(!_this._writableState)·{ |
497 | ····················process.nextTick(emitErrorAndCloseNT,·_this,·err); | 484 | ················process.nextTick(emitErrorAndCloseNT,·_this,·err); |
498 | ················}·else·if·(!_this._writableState.errorEmitted)·{ | 485 | ············}·else·if·(!_this._writableState.errorEmitted)·{ |
499 | ····················_this._writableState.errorEmitted·=·true; | 486 | ················_this._writableState.errorEmitted·=·true; |
500 | ····················process.nextTick(emitErrorAndCloseNT,·_this,·err); | 487 | ················process.nextTick(emitErrorAndCloseNT,·_this,·err); |
501 | ················}·else·{ | |
502 | ····················process.nextTick(emitCloseNT,·_this); | |
503 | ················} | |
504 | ············}·else·if·(cb)·{ | |
505 | ················process.nextTick(emitCloseNT,·_this); | |
506 | ················cb(err); | |
507 | ············}·else·{ | 488 | ············}·else·{ |
508 | ················process.nextTick(emitCloseNT,·_this); | 489 | ················process.nextTick(emitCloseNT,·_this); |
509 | ············} | 490 | ············} |
| 491 | ········}·else·if·(cb)·{ |
| 492 | ············process.nextTick(emitCloseNT,·_this); |
| 493 | ············cb(err); |
| 494 | ········}·else·{ |
| 495 | ············process.nextTick(emitCloseNT,·_this); |
510 | ········}); | 496 | ········} |
| |
511 | ········return·this; | |
512 | ····} | 497 | ····}); |
| |
513 | ····function·emitErrorAndCloseNT(self,·err)·{ | |
514 | ········emitErrorNT(self,·err); | |
515 | ········emitCloseNT(self); | |
516 | ····} | |
| |
| 498 | ····return·this; |
| 499 | } |
517 | ····function·emitCloseNT(self)·{ | |
518 | ········if·(self._writableState·&&·!self._writableState.emitClose)·return; | |
519 | ········if·(self._readableState·&&·!self._readableState.emitClose)·return; | |
520 | ········self.emit('close'); | |
521 | ····} | |
| |
| 500 | function·emitErrorAndCloseNT(self,·err)·{ |
| 501 | ····emitErrorNT(self,·err); |
| 502 | ····emitCloseNT(self); |
| 503 | } |
522 | ····function·undestroy()·{ | |
523 | ········if·(this._readableState)·{ | |
524 | ············this._readableState.destroyed·=·false; | |
525 | ············this._readableState.reading·=·false; | |
526 | ············this._readableState.ended·=·false; | |
527 | ············this._readableState.endEmitted·=·false; | |
528 | ········} | |
| |
| 504 | function·emitCloseNT(self)·{ |
| 505 | ····if·(self._writableState·&&·!self._writableState.emitClose)·return; |
Max diff block lines reached; 6878/12659 bytes (54.33%) of diff not shown.
|