Skip to content

stream: remove isPromise utility function

The function was not checking if the parameter was actually a Promise instance, but if it has a then method. Removing the utility function in favor of a clearer typeof check, handling the case when the thenable throws if then method is accessed more than once.

The difference between a thenable and a Promise may be important when using third party library (the parameter is provided by the user) and/or when Promise.prototype.then value is changed from userland.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

Merge request reports

Loading