0
0
mirror of https://github.com/Doodle3D/Doodle3D-API synced 2024-06-27 14:11:21 +02:00
Doodle3D-API/jspm_packages/npm/core-js@0.9.18/modules/es6.string.from-code-point.js
2015-07-15 15:06:18 +02:00

19 lines
689 B
JavaScript

/* */
var $def = require("./$.def"),
toIndex = require("./$").toIndex,
fromCharCode = String.fromCharCode,
$fromCodePoint = String.fromCodePoint;
$def($def.S + $def.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', {fromCodePoint: function fromCodePoint(x) {
var res = [],
len = arguments.length,
i = 0,
code;
while (len > i) {
code = +arguments[i++];
if (toIndex(code, 0x10ffff) !== code)
throw RangeError(code + ' is not a valid code point');
res.push(code < 0x10000 ? fromCharCode(code) : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00));
}
return res.join('');
}});