Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixup! stream: update TextEncoderStream to align the latest spec
  • Loading branch information
cola119 committed Aug 3, 2022
commit c44d983946d5c323e5c5275d8410cbfe2453c34d
3 changes: 2 additions & 1 deletion lib/internal/webstreams/encoding.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const {
ObjectDefineProperties,
Symbol,
String,
StringPrototypeCharCodeAt,
Uint8Array,
} = primordials;

Expand Down Expand Up @@ -62,7 +63,7 @@ class TextEncoderStream {
let finalChunk = '';
for (let i = 0; i < chunk.length; i++) {
const item = chunk[i];
const codeUnit = item.charCodeAt(0);
const codeUnit = StringPrototypeCharCodeAt(item, 0);
if (this[kPendingHighSurrogate] !== null) {
const highSurrogate = this[kPendingHighSurrogate];
this[kPendingHighSurrogate] = null;
Expand Down