Skip to content

Commit

Permalink
lib: rename TransferedReadableStream etc
Browse files Browse the repository at this point in the history
PR-URL: #39352
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
tniessen authored and targos committed Jul 13, 2021
1 parent fb6616e commit ecf627a
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 28 deletions.
34 changes: 17 additions & 17 deletions lib/internal/webstreams/readablestream.js
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ class ReadableStream {
// Web Platform Tests that check for use of a modified
// Promise.prototype.then. Since the await keyword
// uses Promise.prototype.then, it is open to prototype
// polution, which causes the test to fail. The other
// pollution, which causes the test to fail. The other
// await uses here do not trigger that failure because
// the test that fails does not trigger those code paths.
next() {
Expand Down Expand Up @@ -526,7 +526,7 @@ class ReadableStream {
return {
data: { port: this[kState].transfer.port2 },
deserializeInfo:
'internal/webstreams/readablestream:TransferedReadableStream'
'internal/webstreams/readablestream:TransferredReadableStream'
};
}

Expand Down Expand Up @@ -561,7 +561,7 @@ ObjectDefineProperties(ReadableStream.prototype, {
tee: { enumerable: true },
});

function TransferedReadableStream() {
function TransferredReadableStream() {
return makeTransferable(ReflectConstruct(
function() {
this[kType] = 'ReadableStream';
Expand All @@ -579,7 +579,7 @@ function TransferedReadableStream() {
},
[], ReadableStream));
}
TransferedReadableStream.prototype[kDeserialize] = () => {};
TransferredReadableStream.prototype[kDeserialize] = () => {};

class ReadableStreamBYOBRequest {
[kType] = 'ReadableStreamBYOBRequest';
Expand Down Expand Up @@ -1478,8 +1478,8 @@ function readableByteStreamControllerConvertPullIntoDescriptor(desc) {
if (bytesFilled > byteLength)
throw new ERR_INVALID_STATE.RangeError('The buffer size is invalid');
assert(!(bytesFilled % elementSize));
const transferedBuffer = transferArrayBuffer(buffer);
return new ctor(transferedBuffer, byteOffset, bytesFilled / elementSize);
const transferredBuffer = transferArrayBuffer(buffer);
return new ctor(transferredBuffer, byteOffset, bytesFilled / elementSize);
}

function isReadableStreamLocked(stream) {
Expand Down Expand Up @@ -2100,15 +2100,15 @@ function readableByteStreamControllerPullInto(
const byteLength = ArrayBufferViewGetByteLength(view);
const bufferByteLength = ArrayBufferGetByteLength(buffer);

let transferedBuffer;
let transferredBuffer;
try {
transferedBuffer = transferArrayBuffer(buffer);
transferredBuffer = transferArrayBuffer(buffer);
} catch (error) {
readIntoRequest[kError](error);
return;
}
const desc = {
buffer: transferedBuffer,
buffer: transferredBuffer,
bufferByteLength,
byteOffset,
byteLength,
Expand Down Expand Up @@ -2241,7 +2241,7 @@ function readableByteStreamControllerEnqueue(
if (closeRequested || stream[kState].state !== 'readable')
return;

const transferedBuffer = transferArrayBuffer(buffer);
const transferredBuffer = transferArrayBuffer(buffer);

if (pendingPullIntos.length) {
const firstPendingPullInto = pendingPullIntos[0];
Expand All @@ -2263,19 +2263,19 @@ function readableByteStreamControllerEnqueue(
if (!readableStreamGetNumReadRequests(stream)) {
readableByteStreamControllerEnqueueChunkToQueue(
controller,
transferedBuffer,
transferredBuffer,
byteOffset,
byteLength);
} else {
assert(!queue.length);
const transferedView =
new Uint8Array(transferedBuffer, byteOffset, byteLength);
readableStreamFulfillReadRequest(stream, transferedView, false);
const transferredView =
new Uint8Array(transferredBuffer, byteOffset, byteLength);
readableStreamFulfillReadRequest(stream, transferredView, false);
}
} else if (readableStreamHasBYOBReader(stream)) {
readableByteStreamControllerEnqueueChunkToQueue(
controller,
transferedBuffer,
transferredBuffer,
byteOffset,
byteLength);
readableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(
Expand All @@ -2284,7 +2284,7 @@ function readableByteStreamControllerEnqueue(
assert(!isReadableStreamLocked(stream));
readableByteStreamControllerEnqueueChunkToQueue(
controller,
transferedBuffer,
transferredBuffer,
byteOffset,
byteLength);
}
Expand Down Expand Up @@ -2663,7 +2663,7 @@ module.exports = {
ReadableStreamBYOBRequest,
ReadableByteStreamController,
ReadableStreamDefaultController,
TransferedReadableStream,
TransferredReadableStream,

// Exported Brand Checks
isReadableStream,
Expand Down
4 changes: 2 additions & 2 deletions lib/internal/webstreams/transfer.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class CrossRealmTransformReadableSource {

port.onmessageerror = () => {
const error = new CloneableDOMException(
'Internal transfered ReadableStream error',
'Internal transferred ReadableStream error',
'DataCloneError');
port.postMessage({ type: 'error', value: error });
readableStreamDefaultControllerError(
Expand Down Expand Up @@ -201,7 +201,7 @@ class CrossRealmTransformWritableSink {
};
port.onmessageerror = () => {
const error = new CloneableDOMException(
'Internal transfered ReadableStream error',
'Internal transferred ReadableStream error',
'DataCloneError');
port.postMessage({ type: 'error', value: error });
writableStreamDefaultControllerErrorIfNeeded(
Expand Down
8 changes: 4 additions & 4 deletions lib/internal/webstreams/transformstream.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ class TransformStream {
writable,
},
deserializeInfo:
'internal/webstreams/transformstream:TransferedTransformStream'
'internal/webstreams/transformstream:TransferredTransformStream'
};
}

Expand All @@ -230,7 +230,7 @@ ObjectDefineProperties(TransformStream.prototype, {
writable: { enumerable: true },
});

function TransferedTransformStream() {
function TransferredTransformStream() {
return makeTransferable(ReflectConstruct(
function() {
this[kType] = 'TransformStream';
Expand All @@ -248,7 +248,7 @@ function TransferedTransformStream() {
},
[], TransformStream));
}
TransferedTransformStream.prototype[kDeserialize] = () => {};
TransferredTransformStream.prototype[kDeserialize] = () => {};

class TransformStreamDefaultController {
[kType] = 'TransformStreamDefaultController';
Expand Down Expand Up @@ -583,7 +583,7 @@ function transformStreamDefaultSourcePullAlgorithm(stream) {
module.exports = {
TransformStream,
TransformStreamDefaultController,
TransferedTransformStream,
TransferredTransformStream,

// Exported Brand Checks
isTransformStream,
Expand Down
2 changes: 1 addition & 1 deletion lib/internal/webstreams/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ function transferArrayBuffer(buffer) {
const res = detachArrayBuffer(buffer);
if (res === undefined) {
throw new ERR_OPERATION_FAILED.TypeError(
'The ArrayBuffer could not be transfered');
'The ArrayBuffer could not be transferred');
}
return res;
}
Expand Down
8 changes: 4 additions & 4 deletions lib/internal/webstreams/writablestream.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ class WritableStream {
return {
data: { port: this[kState].transfer.port2 },
deserializeInfo:
'internal/webstreams/writablestream:TransferedWritableStream'
'internal/webstreams/writablestream:TransferredWritableStream'
};
}

Expand Down Expand Up @@ -286,7 +286,7 @@ ObjectDefineProperties(WritableStream.prototype, {
getWriter: { enumerable: true },
});

function TransferedWritableStream() {
function TransferredWritableStream() {
return makeTransferable(ReflectConstruct(
function() {
this[kType] = 'WritableStream';
Expand Down Expand Up @@ -332,7 +332,7 @@ function TransferedWritableStream() {
},
[], WritableStream));
}
TransferedWritableStream.prototype[kDeserialize] = () => {};
TransferredWritableStream.prototype[kDeserialize] = () => {};

class WritableStreamDefaultWriter {
[kType] = 'WritableStreamDefaultWriter';
Expand Down Expand Up @@ -1278,7 +1278,7 @@ module.exports = {
WritableStream,
WritableStreamDefaultWriter,
WritableStreamDefaultController,
TransferedWritableStream,
TransferredWritableStream,

// Exported Brand Checks
isWritableStream,
Expand Down

0 comments on commit ecf627a

Please sign in to comment.