Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: nodejs/node-v0.x-archive
base: 508a6c2eeec7
Choose a base ref
...
head repository: nodejs/node-v0.x-archive
compare: 993bb93e0a58
Choose a head ref
  • 1 commit
  • 6 files changed
  • 1 contributor

Commits on Jul 25, 2013

  1. streams: Don't emit 'end' until read() past EOF

    This prevents the following sort of thing from being confusing:
    
    ```javascript
    stream.on('data', function() { console.error('got data'); });
    stream.pause(); // stop reading
    
    // turns out no data is available
    stream.push(null);
    
    // Hand the stream to someone else, who does stuff...
    setTimeout(function() {
      // too late! 'end' is already emitted!
      stream.on('end', function() { console.error('got end'); });
    });
    ```
    
    With this change, the `end` event is not emitted until you call `read()`
    *past* the EOF null.  So, a paused stream will not swallow the `end`
    event and emit it before you `resume()` the stream.
    isaacs committed Jul 25, 2013
    Copy the full SHA
    993bb93 View commit details
    Browse the repository at this point in the history