Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

process: refactor promise rejection handling #25200

Closed
wants to merge 4 commits into from

Commits on Jan 4, 2019

  1. src: refactor tickInfo access

    - Wrap access to tickInfo fields in functions
    - Rename `kHasScheduled` to `kHasTickScheduled` and
      `kHasPromiseRejections` to `kHasRejectionToWarn` for clarity - note
      the latter will be set to false if the rejection does not lead to
      a warning so the previous description is not accurate.
    - Set `kHasRejectionToWarn` in JS land of relying on C++ to use
      an implict contract (return value of the promise rejection handler)
      to set it, as the decision is made entirely in JS land.
    - Destructure promise reject event constants.
    joyeecheung committed Jan 4, 2019
    Configuration menu
    Copy the full SHA
    a9bd4b0 View commit details
    Browse the repository at this point in the history
  2. process: make tick callback and promise rejection callback more robust

    - Rename `internalTickCallback` to `processTicksAndRejections`, make
      sure it does not get called if it's not set in C++.
    - Rename `emitPromiseRejectionWarnings` to `processPromiseRejections`
      since it also emit events that are not warnings.
    - Sets `SetPromiseRejectCallback` in the `Environment` constructor
      to make sure it only gets called once per-isolate, and make
      sure it does not get called if it's not set in C++.
    - Wrap promise rejection callback initialization into
      `listenForRejections()`.
    - Add comments.
    joyeecheung committed Jan 4, 2019
    Configuration menu
    Copy the full SHA
    8f78021 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    bdad2db View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    4a6765b View commit details
    Browse the repository at this point in the history