diff --git a/packages/core-js/modules/web.atob.js b/packages/core-js/modules/web.atob.js index c3221c6647c0..1f6b31594e2d 100644 --- a/packages/core-js/modules/web.atob.js +++ b/packages/core-js/modules/web.atob.js @@ -47,7 +47,7 @@ $({ global: true, bind: true, enumerable: true, forced: FORCED }, { // `webpack` dev server bug on IE global methods - use call(fn, global, ...) if (BASIC && !NO_SPACES_IGNORE && !NO_ENCODING_CHECK) return call($atob, globalThis, data); var string = replace(toString(data), whitespaces, ''); - var output = ''; + var output = []; var position = 0; var bc = 0; var length, chr, bs; @@ -61,7 +61,7 @@ $({ global: true, bind: true, enumerable: true, forced: FORCED }, { while (position < length) { chr = charAt(string, position++); bs = bc % 4 ? bs * 64 + c2i[chr] : c2i[chr]; - if (bc++ % 4) output += fromCharCode(255 & bs >> (-2 * bc & 6)); - } return output; + if (bc++ % 4) output.push(fromCharCode(255 & bs >> (-2 * bc & 6))); + } return output.join(''); } }); diff --git a/packages/core-js/modules/web.btoa.js b/packages/core-js/modules/web.btoa.js index b8bda16c5b17..28f317e3f468 100644 --- a/packages/core-js/modules/web.btoa.js +++ b/packages/core-js/modules/web.btoa.js @@ -35,7 +35,7 @@ $({ global: true, bind: true, enumerable: true, forced: !BASIC || NO_ARG_RECEIVI // `webpack` dev server bug on IE global methods - use call(fn, global, ...) if (BASIC) return call($btoa, globalThis, toString(data)); var string = toString(data); - var output = ''; + var output = []; var position = 0; var map = i2c; var block, charCode; @@ -45,7 +45,7 @@ $({ global: true, bind: true, enumerable: true, forced: !BASIC || NO_ARG_RECEIVI throw new (getBuiltIn('DOMException'))('The string contains characters outside of the Latin1 range', 'InvalidCharacterError'); } block = block << 8 | charCode; - output += charAt(map, 63 & block >> 8 - position % 1 * 8); - } return output; + output.push(charAt(map, 63 & block >> 8 - position % 1 * 8)); + } return output.join(''); } });