diff --git a/lib/internal/webstreams/readablestream.js b/lib/internal/webstreams/readablestream.js index a8024c64af2353..978281dfa324e8 100644 --- a/lib/internal/webstreams/readablestream.js +++ b/lib/internal/webstreams/readablestream.js @@ -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() { @@ -526,7 +526,7 @@ class ReadableStream { return { data: { port: this[kState].transfer.port2 }, deserializeInfo: - 'internal/webstreams/readablestream:TransferedReadableStream' + 'internal/webstreams/readablestream:TransferredReadableStream' }; } @@ -561,7 +561,7 @@ ObjectDefineProperties(ReadableStream.prototype, { tee: { enumerable: true }, }); -function TransferedReadableStream() { +function TransferredReadableStream() { return makeTransferable(ReflectConstruct( function() { this[kType] = 'ReadableStream'; @@ -579,7 +579,7 @@ function TransferedReadableStream() { }, [], ReadableStream)); } -TransferedReadableStream.prototype[kDeserialize] = () => {}; +TransferredReadableStream.prototype[kDeserialize] = () => {}; class ReadableStreamBYOBRequest { [kType] = 'ReadableStreamBYOBRequest'; @@ -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) { @@ -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, @@ -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]; @@ -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( @@ -2284,7 +2284,7 @@ function readableByteStreamControllerEnqueue( assert(!isReadableStreamLocked(stream)); readableByteStreamControllerEnqueueChunkToQueue( controller, - transferedBuffer, + transferredBuffer, byteOffset, byteLength); } @@ -2663,7 +2663,7 @@ module.exports = { ReadableStreamBYOBRequest, ReadableByteStreamController, ReadableStreamDefaultController, - TransferedReadableStream, + TransferredReadableStream, // Exported Brand Checks isReadableStream, diff --git a/lib/internal/webstreams/transfer.js b/lib/internal/webstreams/transfer.js index 72cdc36a153564..985d7e86738f35 100644 --- a/lib/internal/webstreams/transfer.js +++ b/lib/internal/webstreams/transfer.js @@ -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( @@ -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( diff --git a/lib/internal/webstreams/transformstream.js b/lib/internal/webstreams/transformstream.js index 745675266f7f1b..62940a1fb9da76 100644 --- a/lib/internal/webstreams/transformstream.js +++ b/lib/internal/webstreams/transformstream.js @@ -211,7 +211,7 @@ class TransformStream { writable, }, deserializeInfo: - 'internal/webstreams/transformstream:TransferedTransformStream' + 'internal/webstreams/transformstream:TransferredTransformStream' }; } @@ -230,7 +230,7 @@ ObjectDefineProperties(TransformStream.prototype, { writable: { enumerable: true }, }); -function TransferedTransformStream() { +function TransferredTransformStream() { return makeTransferable(ReflectConstruct( function() { this[kType] = 'TransformStream'; @@ -248,7 +248,7 @@ function TransferedTransformStream() { }, [], TransformStream)); } -TransferedTransformStream.prototype[kDeserialize] = () => {}; +TransferredTransformStream.prototype[kDeserialize] = () => {}; class TransformStreamDefaultController { [kType] = 'TransformStreamDefaultController'; @@ -583,7 +583,7 @@ function transformStreamDefaultSourcePullAlgorithm(stream) { module.exports = { TransformStream, TransformStreamDefaultController, - TransferedTransformStream, + TransferredTransformStream, // Exported Brand Checks isTransformStream, diff --git a/lib/internal/webstreams/util.js b/lib/internal/webstreams/util.js index e0876caf81b944..8cf31d1c307ca9 100644 --- a/lib/internal/webstreams/util.js +++ b/lib/internal/webstreams/util.js @@ -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; } diff --git a/lib/internal/webstreams/writablestream.js b/lib/internal/webstreams/writablestream.js index 793ae9e9ad8fb4..c36ce82fcdcfbf 100644 --- a/lib/internal/webstreams/writablestream.js +++ b/lib/internal/webstreams/writablestream.js @@ -258,7 +258,7 @@ class WritableStream { return { data: { port: this[kState].transfer.port2 }, deserializeInfo: - 'internal/webstreams/writablestream:TransferedWritableStream' + 'internal/webstreams/writablestream:TransferredWritableStream' }; } @@ -286,7 +286,7 @@ ObjectDefineProperties(WritableStream.prototype, { getWriter: { enumerable: true }, }); -function TransferedWritableStream() { +function TransferredWritableStream() { return makeTransferable(ReflectConstruct( function() { this[kType] = 'WritableStream'; @@ -332,7 +332,7 @@ function TransferedWritableStream() { }, [], WritableStream)); } -TransferedWritableStream.prototype[kDeserialize] = () => {}; +TransferredWritableStream.prototype[kDeserialize] = () => {}; class WritableStreamDefaultWriter { [kType] = 'WritableStreamDefaultWriter'; @@ -1278,7 +1278,7 @@ module.exports = { WritableStream, WritableStreamDefaultWriter, WritableStreamDefaultController, - TransferedWritableStream, + TransferredWritableStream, // Exported Brand Checks isWritableStream,