"pull", pullFunction);
    @putByIdDirectPrivate(branch1Source, "cancel", @readableStreamTeeBranch1CancelFunction(teeState, stream));

    const branch2Source = { };
    @putByIdDirectPrivate(branch2Source, "pull", pullFunction);
    @putByIdDirectPrivate(branch2Source, "cancel", @readableStreamTeeBranch2CancelFunction(teeState, stream));

    const branch1 = @createInternalReadableStreamFromUnderlyingSource(branch1Source);
    const branch2 = @createInternalReadableStreamFromUnderlyingSource(branch2Source);

    @getByIdDirectPrivate(reader, "closedPromiseCapability").promise.@then(@undefined, function(e) {
        @readableStreamDefaultControllerError(branch1.@readableStreamController, e);
        @readableStreamDefaultControllerError(branch2.@readableStreamController, e);
        if (!teeState.canceled1 || !teeState.canceled2)
            teeState.cancelPromiseCapability.resolve.@call();
    });

    //
    teeState.branch1 = branch1;
    teeState.branch2 = branch2;

    return [branch1, branch2];
})
