1 var $ = require('../internals/export');
2 var toAbsoluteIndex = require('../internals/to-absolute-index');
4 var fromCharCode = String.fromCharCode;
5 var nativeFromCodePoint = String.fromCodePoint;
7 // length should be 1, old FF problem
8 var INCORRECT_LENGTH = !!nativeFromCodePoint && nativeFromCodePoint.length != 1;
10 // `String.fromCodePoint` method
11 // https://tc39.github.io/ecma262/#sec-string.fromcodepoint
12 $({ target: 'String', stat: true, forced: INCORRECT_LENGTH }, {
13 fromCodePoint: function fromCodePoint(x) { // eslint-disable-line no-unused-vars
15 var length = arguments.length;
19 code = +arguments[i++];
20 if (toAbsoluteIndex(code, 0x10FFFF) !== code) throw RangeError(code + ' is not a valid code point');
21 elements.push(code < 0x10000
23 : fromCharCode(((code -= 0x10000) >> 10) + 0xD800, code % 0x400 + 0xDC00)
25 } return elements.join('');