function requestActiveBuffers(subtree, bufferHeaders, internalBuffer) {
  const promises = [];
  for (let i = 0; i < bufferHeaders.length; i++) {
    const bufferHeader = bufferHeaders[i];
    if (!bufferHeader.isActive) {
      promises.push(Promise.resolve(undefined));
    } else if (bufferHeader.isExternal) {
      const promise = requestExternalBuffer(subtree, bufferHeader);
      promises.push(promise);
    } else {
      promises.push(Promise.resolve(internalBuffer));
    }
  }
  return Promise.all(promises).then(function (bufferResults) {
    const buffersU8 = {};
    for (let i = 0; i < bufferResults.length; i++) {
      const result = bufferResults[i];
      if (defined(result)) {
        buffersU8[i] = result;
      }
    }
    return buffersU8;
  });
}
Go through the list of buffers and gather all the active ones into a
a dictionary. Since external buffers are allowed, this sometimes involves
fetching separate binary files. Consequently, this method returns a promise.
<p>
The results are put into a dictionary object. The keys are indices of
buffers, and the values are Uint8Arrays of the contents. Only buffers
marked with the isActive flag are fetched.
</p>
<p>
The internal buffer (the subtree's binary chunk) is also stored in this
dictionary if it is marked active.
</p>
@param {ImplicitSubtree} subtree The subtree
@param {BufferHeader[]} bufferHeaders The preprocessed buffer headers
@param {Uint8Array} internalBuffer The binary chunk of the subtree file
@returns {Promise<object>} A promise resolving to the dictionary of active buffers
@private