Skip to content

Commits on Aug 14, 2020

  1. Support transferable streams (postMessage)

    Make readable, writable, and transform streams transferable via
    postMessage(stream, [stream]).
    The streams themselves must be transferred, but the chunks written or
    read from the streams are cloned, not transferred. Support for
    transferring chunks will require API changes and is expected to be added
    in a future update.
    There is no reference implementation of this functionality as jsdom does
    not support transferrable objects, and so it wouldn't be testable.
    Closes #276.
    ricea committed Aug 14, 2020

Commits on Aug 13, 2020

  1. Editorial: add cross-links to internal slots

    As part of this, we split out the common features of readable stream readers into the ReadableStreamGenericReader mixin. Despite this changing the IDL, it has no observable behavior changes.
    Inspired by #1048.
    MattiasBuelens committed Aug 13, 2020

Commits on Aug 5, 2020

  1. Always resolve tee's cancel promise after stream closes or errors

    Fixes #1038.
    MattiasBuelens committed Aug 5, 2020

Commits on Aug 4, 2020

  1. Editorial: make quotes around code-font words consistent

    Some quoted code font words in the standard had a quote in code font on
    one side and proportional font on the other side. Fix it so that all
    quoted code font words have both quotes in proportional font.
    ricea committed Aug 4, 2020
  2. Editorial: rename internal slots for brevity

    * [[readableStreamController]] -> [[controller]
    * [[ownerReadableStream]] -> stream
    * [[controlledReadableStream]] -> [[stream]]
    * [[writableStreamController]] -> [[controller]]
    * [[ownerWritableStream]] -> [[stream]]
    * [[controlledWritableStream]] -> [[stream]]
    * [[transformStreamController]] -> [[controller]]
    * Reduce redundant variable declarations
    domenic committed Aug 4, 2020

Commits on Jul 28, 2020

  1. Editorial: tweak constructor/getter step introductions

    Aligns with heycam/webidl#882.
    domenic committed Jul 28, 2020

Commits on Jul 27, 2020

  1. Add examples for stopping pipes

    Closes #1055.
    domenic committed Jul 27, 2020

Commits on Jul 24, 2020

  1. Meta: update web platform tests

    MattiasBuelens committed Jul 24, 2020

Commits on Jul 20, 2020

  1. Remove obsolete asserts

    These asserts no longer appear in the spec text, since they were made redundant by the WebIDL rewrite. Therefore, they should also be removed from the reference implementation.
    MattiasBuelens committed Jul 20, 2020

Commits on Jul 16, 2020

  1. Fix argument order in UnderlyingSinkWriteCallback and TransformerTran…

    …sformCallback definitions
    * Fix argument order in UnderlyingSinkWriteCallback WebIDL definition
    * Fix argument order in TransformerTransformCallback WebIDL definition
    MattiasBuelens committed Jul 16, 2020

Commits on Jul 7, 2020

  1. Fix couple typos

    In particular, fixes a bad reference to ReadableStreamDefaultReader, and
    replaces a repeated preventCancel parameter with the missing
    Jamesernator committed Jul 7, 2020
  2. Editorial: various fixes

    * Fix typo in Close/Enqueue checks for readable byte streams
    * Remove redundant check in TransformStreamDefaultSinkCloseAlgorithm
    * Fix link IDs for TransformStream abstract ops
    MattiasBuelens committed Jul 7, 2020

Commits on Jul 6, 2020

  1. Editorial: remove forAuthorCode and use dictionaries for read()

    Fixes #1036.
    domenic committed Jul 6, 2020

Commits on Jun 29, 2020

  1. Meta: update repository files

    foolip authored and annevk committed Jun 29, 2020

Commits on Jun 25, 2020

  1. Editorial: use structs instead of records

    Closes #670.
    The main advantage here is that it lets us define the structs and their items in more detail, so that the reader has a better chance of knowing what they mean. Additionally, we can easily cross-link to the item definitions from their usage sites.
    It also has the minor advantage of moving us more toward other web specifications, and reducing the problem posed by #825.
    This includes the following changes that go beyond a fancy search-and-replace:
    * Instead of representing a writable stream's internal queue as containing chunks that were either the string "close" or a Record{ [[chunk]]: jsValue }}, we use a "close sentinel" value which can be used alongside the chunks directly.
    * The "ctor" record field in the pending pull-into descriptors is renamed to "view constructor".
    domenic committed Jun 25, 2020

Commits on Jun 23, 2020

  1. Meta: run idlharness tests on reference implementation

    Fixes #1044.
    MattiasBuelens committed Jun 23, 2020

Commits on Jun 14, 2020

  1. Fix typo in pipeTo description

    Replace incorrect reference to `preventCancel` with `preventClose`.
    MattiasBuelens committed Jun 14, 2020

Commits on Jun 13, 2020

  1. Meta: run reference-implementation tests on GitHub Actions

    foolip committed Jun 13, 2020

Commits on Jun 12, 2020

Commits on Jun 11, 2020

  1. Rewrite to use Web IDL, and generally modernize

    Closes #963.
    Normative changes to widely-implemented features, roughly in order of most disruptive to least-disruptive:
    * For the queuing strategy classes, their size and highWaterMark properties are now getters on the prototype, instead of data properties on the prototype and instance (respectively). Closes #1005. In particular this means that attempts to set either of them post-creation will throw a TypeError. Chromium already ships these semantics.
    * Functions which take a dictionary no longer accept non-objects.
    * For the queuing strategy classes, their highWaterMark property will no longer return a non-number from their highWaterMark properties, if one was passed to the constructor. Instead, NaN will be returned.
    * All methods and accessors are now enumerable, per Web IDL defaults, instead of non-enumerable, per ECMAScript defaults.
    * All classes are now exposed globally. Formerly, ReadableStreamDefaultReader, ReadableStreamBYOBReader, ReadableStreamDefaultController, ReadableByteStreamController, WritableStreamDefaultWriter, WritableStreamDefaultController, and TransformStreamDefaultController were not exposed. Closes #586.
    * All classes now have [Symbol.toStringTag] properties. Closes #952.
    * Some functions have changed their length property value.
    * Some exceptions are thrown earlier, at argument-conversion time.
    * Property lookup in options arguments now happens earlier, at argument-conversion time, and in alphabetical order, per dictionary rules.
    Normative changes to unimplemented features:
    * ReadableStream's getIterator() method has been renamed to values() as part of adopting Web IDL's infrastructure for async iterators.
    * The byobRequest property on ReadableByteStreamController now returns null when there is no BYOB request, instead of returning undefined.
    * The view property on ReadableStreamBYOBRequest now returns null when the view cannot be written into, instead of returning undefined.
    * Various byte-stream-related APIs that used to specifically prohibit detached buffers now check for zero-length views or buffers, which is a more general category.
    * The async iterator's next() and return() methods now behave more like async generators, e.g. returning promises fulfilled with { value: undefined, done: true } after return()ing the iterator, instead of returning a rejected promise.
    Editorial changes:
    * All APIs are specified to using Web IDL now, instead of using a modified version of the ECMAScript specification conventions. We continue using abstract operations and completion records for now, and we have to drop down to the ECMAScript level in a couple places (notably for dealing with %ObjectPrototype% vs. null-prototype iteration result objects, and transferring array buffers). But overall this removes a lot of type-checking and conversion boilerplate from the specification. Closes #963. Closes #1017. See #1036 for further followup on the iteration result objects.
    * Individual abstract operations, constructors, methods, and properties no longer have their own heading. They are instead lumped together in sections. Closes #885.
    * The constructors, methods, and properties are now documented in a per-class block, using the usual WHATWG "domintro" style. Closes #907.
    * Abstract operations are now consistently alphabetized within their section. Closes #684.
    * By using Bikeshed's <div algorithm> feature, we now get automatic identifier highlighting. Closes #687.
    * Switched to 100-character line limits, 1-space indents, and omitting end tags, per WHATWG conventions.
    * Removed usage of emu-algify in favor of using some more of Bikeshed's built-in features, plus manually annotating a few things.
    * Switched to concise Bikeshed linking syntax, e.g. [=term=] and [$AbstractOp$].
    * Eliminated a number of utility abstract operations, especially around calling functions, by better using Web IDL.
    Other bug fixes:
    * Web IDL makes constructor behavior clear, so this closes #965.
    domenic committed Jun 11, 2020

Commits on Apr 6, 2020

  1. Meta: update repository files

    annevk committed Apr 6, 2020

Commits on Mar 2, 2020

  1. Add state checks to Close() and Enqueue() (#1029)

    Exit early from abstract operations
    ReadableStreamDefaultControllerClose() and
    ReadableStreamDefaultControllerEnqueue() if
    ReadableStreamDefaultControllerCanCloseOrEnqueue() is false. Remove the
    asserts that it is true, and the requirement that callers perform the
    check as part of the interface contract.
    In practice the implementation of ReadableStreamTee() was failing to
    properly check CanCloseOrEnqueue(). By relaxing the interface contract
    we can prevent similar problems with future standards.
    Also remove a now-redundant check of CanCloseOrEnqueue() in
    Also make similar changes to ReadableByteStreamControllerClose() and
    ricea committed Mar 2, 2020

Commits on Feb 17, 2020

  1. Review Draft Publication: February 2020

    foolip authored and annevk committed Feb 17, 2020

Commits on Dec 13, 2019

  1. Export "identity transform stream"

    yutakahirano authored and ricea committed Dec 13, 2019

Commits on Nov 13, 2019

  1. Set [[disturbed]] synchronously in ReadableStreamPipeTo (#1022)

    Set the [[disturbed]] internal slot to true in ReadableStreamPipeTo.
    This is useful for the Fetch Standard.
    See whatwg/fetch#959 for the Fetch Standard
    change that requires this.
    ricea committed Nov 13, 2019

Commits on Nov 3, 2019

  1. Add close() method to WritableStream

    Fixes #1007.
    MattiasBuelens authored and domenic committed Nov 3, 2019
  2. Meta: change promises-guide references to Web IDL

    Fixes #1020.
    MattiasBuelens authored and domenic committed Nov 3, 2019

Commits on Aug 23, 2019

  1. Reference implementation: use the initial values of promise methods

    Before this change, the reference implementation did not use the initial value of the Promise constructor and its methods to implement phrases such as "upon fulfillment of p with value v", although this is required by the promise guide. This causes the reference implementation to fail on the new tests introduced in web-platform-tests/wpt#18452.
    This change adds helper functions to call the original versions of the Promise constructor and its methods. Assuming they haven't been monkey-patched before the reference implementation was loaded, these should be the initial values expected by the spec.
    It also replaces all direct calls to the Promise constructors and its methods with calls to the respective helper functions. This is a purely mechanical change, but it does make for quite a big diff.
    With this change, the reference implementation once again passes all tests.
    MattiasBuelens authored and domenic committed Aug 23, 2019

Commits on Aug 19, 2019

  1. Review Draft Publication: August 2019

    annevk authored and foolip committed Aug 19, 2019

Commits on Jul 29, 2019

  1. Reference implementation: fix pipe not aborting

    When both the preventCancel and preventAbort flags are set, the abortAlgorithm passes an empty list of actions to "wait for all". This helper should immediately resolve the returned promise when no promises are given, but instead the promise remained pending forever.
    This fixes the reference implementation of the "wait for all" helper to resolve correctly when given an empty list of promises. This matches the spec change in w3ctag/promises-guide#58.
    Originally reported in #1004 (comment).
    MattiasBuelens authored and domenic committed Jul 29, 2019

Commits on Apr 2, 2019

  1. ReadableStreamTee: do not read when already pulling

    Currently, when one branch calls pull(), it is possible that we call
    read() - even though a read() is still pending from a previous pull()
    call by the other branch. This can lead to reading too many chunks from
    the original streams, and unnecessarily filling up the queues of the
    branches past their high water mark.
    This PR fixes that issue by only starting a new read() if the previous
    read() was resolved. As a bonus, there will now be only one read() that
    resolves with { done: true } when the original stream closes, so we no
    longer need to keep track of whether we already closed the two branches.
    Fixes #996
    MattiasBuelens authored and ricea committed Apr 2, 2019

Commits on Mar 28, 2019

  1. Make requirements on chunk sizes clearer

    surma authored and domenic committed Mar 28, 2019

Commits on Mar 11, 2019

  1. Remove extra arguments left over from forAuthorCode refactor

    #984 failed to remove two places where an unneeded forAuthorCode argument was passed. Remove them.
    No functional changes.
    MattiasBuelens authored and ricea committed Mar 11, 2019

Commits on Feb 21, 2019

  1. Editorial: in ReadableStreamTee, replace closedOrErrored with closed

    DefaultReaderRead will never resolve after the [[closedPromise]] has rejected,
    therefore setting _closedOrErrored_ on rejection makes no difference. Rename the
    variable to just _closed_ and only use it to signal that a read has returned
    with "done" set to true.
    Also change the lookups of "done" and "value" in ReadableStreamTee from "? Get"
    to "! Get" as they can never throw, and pullAlgorithm returning an abrupt
    completion is not supported anyway.
    Rearrange the steps slightly to reduce redundant work.
    Closes #991.
    ricea authored and domenic committed Feb 21, 2019
  2. Simplify [@@asyncIterator].next()

    - Assert that getting value and done from result cannot throw
    - Rearrange the steps slightly to reduce redundant work
    MattiasBuelens authored and domenic committed Feb 21, 2019
You can’t perform that action at this time.