X-Git-Url: https://git.josue.xyz/?p=dotfiles%2F.git;a=blobdiff_plain;f=.config%2Fcoc%2Fextensions%2Fnode_modules%2Fcoc-prettier%2Fnode_modules%2Fcore-js%2Fmodules%2Fes.string.from-code-point.js;h=27cd210efcd4b9d32df4bd3769e8838879991305;hp=04c27bba469874b5888fc47a2cbb2d9e77a42acd;hb=3be0a9efc698a9570a44456009afc6014812625a;hpb=d2f432cc757f42f0318fdddcab8c00b240d47088 diff --git a/.config/coc/extensions/node_modules/coc-prettier/node_modules/core-js/modules/es.string.from-code-point.js b/.config/coc/extensions/node_modules/coc-prettier/node_modules/core-js/modules/es.string.from-code-point.js index 04c27bba..27cd210e 100644 --- a/.config/coc/extensions/node_modules/coc-prettier/node_modules/core-js/modules/es.string.from-code-point.js +++ b/.config/coc/extensions/node_modules/coc-prettier/node_modules/core-js/modules/es.string.from-code-point.js @@ -1,11 +1,16 @@ var $ = require('../internals/export'); +var global = require('../internals/global'); +var uncurryThis = require('../internals/function-uncurry-this'); var toAbsoluteIndex = require('../internals/to-absolute-index'); +var RangeError = global.RangeError; var fromCharCode = String.fromCharCode; -var nativeFromCodePoint = String.fromCodePoint; +// eslint-disable-next-line es/no-string-fromcodepoint -- required for testing +var $fromCodePoint = String.fromCodePoint; +var join = uncurryThis([].join); // length should be 1, old FF problem -var INCORRECT_LENGTH = !!nativeFromCodePoint && nativeFromCodePoint.length != 1; +var INCORRECT_LENGTH = !!$fromCodePoint && $fromCodePoint.length != 1; // `String.fromCodePoint` method // https://tc39.es/ecma262/#sec-string.fromcodepoint @@ -19,10 +24,9 @@ $({ target: 'String', stat: true, forced: INCORRECT_LENGTH }, { while (length > i) { code = +arguments[i++]; if (toAbsoluteIndex(code, 0x10FFFF) !== code) throw RangeError(code + ' is not a valid code point'); - elements.push(code < 0x10000 + elements[i] = code < 0x10000 ? fromCharCode(code) - : fromCharCode(((code -= 0x10000) >> 10) + 0xD800, code % 0x400 + 0xDC00) - ); - } return elements.join(''); + : fromCharCode(((code -= 0x10000) >> 10) + 0xD800, code % 0x400 + 0xDC00); + } return join(elements, ''); } });