We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ebbf25f commit c44d983Copy full SHA for c44d983
lib/internal/webstreams/encoding.js
@@ -4,6 +4,7 @@ const {
4
ObjectDefineProperties,
5
Symbol,
6
String,
7
+ StringPrototypeCharCodeAt,
8
Uint8Array,
9
} = primordials;
10
@@ -62,7 +63,7 @@ class TextEncoderStream {
62
63
let finalChunk = '';
64
for (let i = 0; i < chunk.length; i++) {
65
const item = chunk[i];
- const codeUnit = item.charCodeAt(0);
66
+ const codeUnit = StringPrototypeCharCodeAt(item, 0);
67
if (this[kPendingHighSurrogate] !== null) {
68
const highSurrogate = this[kPendingHighSurrogate];
69
this[kPendingHighSurrogate] = null;
0 commit comments