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

Function decodeCodePointsArray

docs/tests/v2/es6/js/sanddance.js:79367–79383  ·  view source on GitHub ↗
(codePoints)

Source from the content-addressed store, hash-verified

79365var MAX_ARGUMENTS_LENGTH = 0x1000
79366
79367function decodeCodePointsArray (codePoints) {
79368 var len = codePoints.length
79369 if (len <= MAX_ARGUMENTS_LENGTH) {
79370 return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
79371 }
79372
79373 // Decode in chunks to avoid "call stack size exceeded".
79374 var res = ''
79375 var i = 0
79376 while (i < len) {
79377 res += String.fromCharCode.apply(
79378 String,
79379 codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
79380 )
79381 }
79382 return res
79383}
79384
79385function asciiSlice (buf, start, end) {
79386 var ret = ''

Callers 1

utf8SliceFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected