deps/v8/src/js/promise.js
function PromiseSet(promise, status, value) {
  SET_PRIVATE(promise, promiseStateSymbol, status);
  SET_PRIVATE(promise, promiseResultSymbol, value);

  // There are 3 possible states for the resolve, reject symbols when we add
  // a new callback --
  // 1) UNDEFINED -- This is the zero state where there is no callback
  // registered. When we see this state, we directly attach the callbacks to
  // the symbol.
  // 2) !IS_ARRAY -- There is a single callback directly attached to the
  // symbols. We need to create a new array to store additional callbacks.
  // 3) IS_ARRAY -- There are multiple callbacks already registered,
  // therefore we can just push the new callback to the existing array.
  SET_PRIVATE(promise, promiseFulfillReactionsSymbol, UNDEFINED);
  SET_PRIVATE(promise, promiseRejectReactionsSymbol, UNDEFINED);

  // There are 2 possible states for this symbol --
  // 1) UNDEFINED -- This is the zero state, no deferred object is
  // attached to this symbol. When we want to add a new deferred we
  // directly attach it to this symbol.
  // 2) symbol with attached deferred object -- New deferred objects
  // are not attached to this symbol, but instead they are directly
  // attached to the resolve, reject callback arrays. At this point,
  // the deferred symbol's state is stale, and the deferreds should be
  // read from the reject, resolve callbacks.
  SET_PRIVATE(promise, promiseDeferredReactionsSymbol, UNDEFINED);

  return promise;
}
function PromiseSet(promise, status, value) {
  SET_PRIVATE(promise, promiseStateSymbol, status);
  SET_PRIVATE(promise, promiseResultSymbol, value);

  // There are 3 possible states for the resolve, reject symbols when we add
  // a new callback --
  // 1) UNDEFINED -- This is the zero state where there is no callback
  // registered. When we see this state, we directly attach the callbacks to
  // the symbol.
  // 2) !IS_ARRAY -- There is a single callback directly attached to the
  // symbols. We need to create a new array to store additional callbacks.
  // 3) IS_ARRAY -- There are multiple callbacks already registered,
  // therefore we can just push the new callback to the existing array.
  SET_PRIVATE(promise, promiseFulfillReactionsSymbol, UNDEFINED);
  SET_PRIVATE(promise, promiseRejectReactionsSymbol, UNDEFINED);

  // There are 2 possible states for this symbol --
  // 1) UNDEFINED -- This is the zero state, no deferred object is
  // attached to this symbol. When we want to add a new deferred we
  // directly attach it to this symbol.
  // 2) symbol with attached deferred object -- New deferred objects
  // are not attached to this symbol, but instead they are directly
  // attached to the resolve, reject callback arrays. At this point,
  // the deferred symbol's state is stale, and the deferreds should be
  // read from the reject, resolve callbacks.
  SET_PRIVATE(promise, promiseDeferredReactionsSymbol, UNDEFINED);

  return promise;
}
function PromiseSet ( promise , status , value ) { SET_PRIVATE ( promise , promiseStateSymbol , status ) ; SET_PRIVATE ( promise , promiseResultSymbol , value ) ; // There are 3 possible states for the resolve, reject symbols when we add // a new callback -- // 1) UNDEFINED -- This is the zero state where there is no callback // registered. When we see this state, we directly attach the callbacks to // the symbol. // 2) !IS_ARRAY -- There is a single callback directly attached to the // symbols. We need to create a new array to store additional callbacks. // 3) IS_ARRAY -- There are multiple callbacks already registered, // therefore we can just push the new callback to the existing array. SET_PRIVATE ( promise , promiseFulfillReactionsSymbol , UNDEFINED ) ; SET_PRIVATE ( promise , promiseRejectReactionsSymbol , UNDEFINED ) ; // There are 2 possible states for this symbol -- // 1) UNDEFINED -- This is the zero state, no deferred object is // attached to this symbol. When we want to add a new deferred we // directly attach it to this symbol. // 2) symbol with attached deferred object -- New deferred objects // are not attached to this symbol, but instead they are directly // attached to the resolve, reject callback arrays. At this point, // the deferred symbol's state is stale, and the deferreds should be // read from the reject, resolve callbacks. SET_PRIVATE ( promise , promiseDeferredReactionsSymbol , UNDEFINED ) ; return promise ; }
Core functionality.
Core functionality .