Skip to content

Commit 1e1822b

Browse files
VoltrexKeyvaaduh95
authored andcommitted
stream: rename unknown primordial
The primordials does not expose a primordial called `DataViewCtor`, leading up to a non-existent constructor. Fixes: #40612
1 parent 6df7070 commit 1e1822b

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

lib/internal/webstreams/readablestream.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const {
77
ArrayBufferPrototypeSlice,
88
ArrayPrototypePush,
99
ArrayPrototypeShift,
10-
DataViewCtor,
10+
DataView,
1111
FunctionPrototypeBind,
1212
FunctionPrototypeCall,
1313
MathMin,
@@ -2100,7 +2100,7 @@ function readableByteStreamControllerPullInto(
21002100
pendingPullIntos,
21012101
} = controller[kState];
21022102
let elementSize = 1;
2103-
let ctor = DataViewCtor;
2103+
let ctor = DataView;
21042104
if (isArrayBufferView(view) && !isDataView(view)) {
21052105
elementSize = view.constructor.BYTES_PER_ELEMENT;
21062106
ctor = view.constructor;

test/parallel/test-whatwg-readablestream.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1570,3 +1570,18 @@ class Source {
15701570
isDisturbed(stream, true);
15711571
})().then(common.mustCall());
15721572
}
1573+
1574+
{
1575+
const stream = new ReadableStream({
1576+
type: 'bytes',
1577+
start(controller) {
1578+
controller.close();
1579+
}
1580+
});
1581+
1582+
const buffer = new ArrayBuffer(1024);
1583+
const reader = stream.getReader({ mode: 'byob' });
1584+
1585+
reader.read(new DataView(buffer))
1586+
.then(common.mustCall());
1587+
}

0 commit comments

Comments
 (0)