Add functionality to StreamThenPromise()

ReadableStreamNative needs some extra functionality from
StreamThenPromise():

* Support the single argument form of Then(). The |on_rejected| argument
  is now optional.
* Behave as Catch() by setting the |on_fulfilled| argument to nullptr.
* Return the return value from Then() instead of void. Only a Promise
  resolving to undefined can be created due to the StreamScriptFunction
  API having no provision for a return value, but this is sufficient to
  implement ReadableStream.

BUG=902633

Change-Id: I44f0ba0109568c8fd09882e2f1f05ba50816364a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1523214
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Commit-Queue: Adam Rice <ricea@chromium.org>
Cr-Commit-Position: refs/heads/master@{#641440}
2 files changed