MCPcopy Create free account
hub / github.com/nodejs/node / encodeWtf16LE

Function encodeWtf16LE

deps/v8/test/mjsunit/wasm/imported-strings.js:82–91  ·  view source on GitHub ↗
(str)

Source from the content-addressed store, hash-verified

80}
81
82function encodeWtf16LE(str) {
83 // String iterator coalesces surrogate pairs.
84 let out = [];
85 for (let i = 0; i < str.length; i++) {
86 codeunit = str.charCodeAt(i);
87 out.push(codeunit & 0xff)
88 out.push(codeunit >> 8);
89 }
90 return out;
91}
92
93let kArrayI16;
94let kStringCast;

Callers 2

makeWtf16TestDataSegmentFunction · 0.70

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected