Skip to content
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
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 743cf336167f5ba7947b61c0cb94216b514c87f5
Choose a base ref
...
head repository: nodejs/node
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: f2dd17bde9ad82e26212364a4a9f698c166aa0d5
Choose a head ref
  • 7 commits
  • 18 files changed
  • 3 contributors

Commits on Feb 26, 2018

  1. lib: add process to internal module wrapper

    Share `process` through the module wrapper rather than relying
    on nobody messing with `global.process`.
    
    Backport-PR-URL: #19006
    PR-URL: #17198
    Fixes: #6802
    Reviewed-By: Ben Noordhuis <[email protected]>
    Reviewed-By: James M Snell <[email protected]>
    Reviewed-By: Lance Ball <[email protected]>
    Reviewed-By: Anatoli Papirovski <[email protected]>
    Reviewed-By: Joyee Cheung <[email protected]>
    Reviewed-By: Alexey Orlenko <[email protected]>
    Reviewed-By: Michaël Zasso <[email protected]>
    Reviewed-By: Colin Ihrig <[email protected]>
    Reviewed-By: Timothy Gu <[email protected]>
    Reviewed-By: Refael Ackermann <[email protected]>
    addaleax authored and MylesBorins committed Feb 26, 2018
    Configuration menu
    Copy the full SHA
    738b0a1 View commit details
    Browse the repository at this point in the history
  2. process: refactor nextTick for clarity

    Do not share unnecessary information about nextTick state
    between JS & C++, instead only track whether a nextTick
    is scheduled or not.
    
    Turn nextTickQueue into an Object instead of a class
    since multiple instances are never created.
    
    Other assorted refinements and refactoring.
    
    Backport-PR-URL: #19006
    PR-URL: #17738
    Reviewed-By: Anna Henningsen <[email protected]>
    apapirovski authored and MylesBorins committed Feb 26, 2018
    Configuration menu
    Copy the full SHA
    d348496 View commit details
    Browse the repository at this point in the history
  3. process: do not directly schedule _tickCallback in _fatalException

    When a process encounters a _fatalException that is caught, it should
    schedule execution of nextTicks but not in an arbitrary place of the
    next Immediates queue. Instead, add a no-op function to the queue
    that will ensure processImmediate runs, which will then ensure
    that nextTicks are processed at the end.
    
    Backport-PR-URL: #19006
    PR-URL: #17841
    Reviewed-By: Anna Henningsen <[email protected]>
    Reviewed-By: James M Snell <[email protected]>
    apapirovski authored and MylesBorins committed Feb 26, 2018
    Configuration menu
    Copy the full SHA
    4acea14 View commit details
    Browse the repository at this point in the history
  4. timers: make setImmediate() immune to tampering

    Make setImmediate() immune to `process` global tampering by removing
    the dependency on the `process._immediateCallback` property.
    
    Backport-PR-URL: #19006
    PR-URL: #17736
    Fixes: #17681
    Reviewed-By: Anna Henningsen <[email protected]>
    Reviewed-By: Colin Ihrig <[email protected]>
    Reviewed-By: Tobias Nießen <[email protected]>
    Reviewed-By: Anatoli Papirovski <[email protected]>
    Reviewed-By: Jeremiah Senkpiel <[email protected]>
    Reviewed-By: James M Snell <[email protected]>
    bnoordhuis authored and MylesBorins committed Feb 26, 2018
    Configuration menu
    Copy the full SHA
    8474f86 View commit details
    Browse the repository at this point in the history
  5. src: use AliasedBuffer for TickInfo

    Backport-PR-URL: #19006
    PR-URL: #17881
    Reviewed-By: Anna Henningsen <[email protected]>
    Reviewed-By: Ben Noordhuis <[email protected]>
    Reviewed-By: James M Snell <[email protected]>
    Reviewed-By: Khaidi Chu <[email protected]>
    Reviewed-By: Tobias Nießen <[email protected]>
    apapirovski authored and MylesBorins committed Feb 26, 2018
    Configuration menu
    Copy the full SHA
    07c6fb9 View commit details
    Browse the repository at this point in the history
  6. timers: refactor setImmediate error handling

    If an error is encountered during the processing of Immediates, schedule
    the remaining queue to finish after all error handling code runs (if the
    process is still alive to do so). The new changes make the Immediates
    error handling behaviour entirely deterministic and predictable, as the
    full queue will be flushed on each Immediates cycle, regardless of
    whether an error is encountered or not.
    
    Currently this processing is scheduled for nextTick which can yield
    unpredictable results as the nextTick might happen as early as close
    callbacks phase or as late as after the next event loop turns Immediates
    all fully processed. The latter can result in two full cycles of
    Immediates processing during one even loop turn.
    
    The current implementation also doesn't differentiate between Immediates
    scheduled for the current queue run or the next one, so Immediates that
    were scheduled for the next turn of the event loop, will process
    alongside the ones that were scheduled for the current turn.
    
    Backport-PR-URL: #19006
    PR-URL: #17879
    Reviewed-By: Anna Henningsen <[email protected]>
    Reviewed-By: James M Snell <[email protected]>
    apapirovski authored and MylesBorins committed Feb 26, 2018
    Configuration menu
    Copy the full SHA
    37f253e View commit details
    Browse the repository at this point in the history
  7. timers: allow Immediates to be unrefed

    Refactor Immediates handling to allow for them to be unrefed, similar
    to setTimeout, but without extra handles.
    
    Document the new `immediate.ref()` and `immediate.unref()` methods.
    
    Add SetImmediateUnref on the C++ side.
    
    Backport-PR-URL: #19006
    PR-URL: #18139
    Reviewed-By: Anna Henningsen <[email protected]>
    Reviewed-By: Franziska Hinkelmann <[email protected]>
    Reviewed-By: James M Snell <[email protected]>
    apapirovski authored and MylesBorins committed Feb 26, 2018
    Configuration menu
    Copy the full SHA
    f2dd17b View commit details
    Browse the repository at this point in the history
Loading