Skip to content

Commit c44d983

Browse files
committed
fixup! stream: update TextEncoderStream to align the latest spec
1 parent ebbf25f commit c44d983

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/internal/webstreams/encoding.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const {
44
ObjectDefineProperties,
55
Symbol,
66
String,
7+
StringPrototypeCharCodeAt,
78
Uint8Array,
89
} = primordials;
910

@@ -62,7 +63,7 @@ class TextEncoderStream {
6263
let finalChunk = '';
6364
for (let i = 0; i < chunk.length; i++) {
6465
const item = chunk[i];
65-
const codeUnit = item.charCodeAt(0);
66+
const codeUnit = StringPrototypeCharCodeAt(item, 0);
6667
if (this[kPendingHighSurrogate] !== null) {
6768
const highSurrogate = this[kPendingHighSurrogate];
6869
this[kPendingHighSurrogate] = null;

0 commit comments

Comments
 (0)