MCPcopy Create free account
hub / github.com/microsoft/SandDance / decodeCodePointsArray

Function decodeCodePointsArray

docs/tests/v3/es6/js/sanddance-test-es6.js:61465–61474  ·  view source on GitHub ↗
(codePoints)

Source from the content-addressed store, hash-verified

61463// We go 1 magnitude less, for safety
61464var MAX_ARGUMENTS_LENGTH = 0x1000;
61465function decodeCodePointsArray(codePoints) {
61466 var len = codePoints.length;
61467 if (len <= MAX_ARGUMENTS_LENGTH) return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
61468 ;
61469 // Decode in chunks to avoid "call stack size exceeded".
61470 var res = "";
61471 var i = 0;
61472 while(i < len)res += String.fromCharCode.apply(String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH));
61473 return res;
61474}
61475function asciiSlice(buf, start, end) {
61476 var ret = "";
61477 end = Math.min(buf.length, end);

Callers 1

utf8SliceFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected