From: Daniel Cousens Date: Sat, 15 Aug 2015 15:52:12 +0000 (+1000) Subject: restructure decodeCodePointsArray comment X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=118e54ad9e6cb94a3f1290551cd2694f8c5a107a;p=buffer.git restructure decodeCodePointsArray comment --- diff --git a/index.js b/index.js index ec7b75d..c47a92d 100644 --- a/index.js +++ b/index.js @@ -635,12 +635,12 @@ function decodeLargeCodePointsArray (array) { } function decodeCodePointsArray (array) { - if (array.length < 0x10000) { - return String.fromCharCode.apply(String, array) - } - // Decode using string concatenation to avoid "call stack size exceeded". // Based on http://stackoverflow.com/a/22747272/680742, the browser with - // the lowest limit is Chrome, with 0x10000 args. + // the lowest argument limit is Chrome, with 0x10000 args. + if (array.length < 0x10000) return String.fromCharCode.apply(String, array) + + // If above that limit, decode using string concatenation + // to avoid "call stack size exceeded". return decodeLargeCodePointsArray(array) }