]> gerrit.simantics Code Review - simantics/district.git/blob - org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/from-code-point/shim.js
Adding integrated tile server
[simantics/district.git] / org.simantics.maps.server / node / node-v4.8.0-win-x64 / node_modules / npm / node_modules / node-gyp / node_modules / path-array / node_modules / array-index / node_modules / es6-symbol / node_modules / es5-ext / string / from-code-point / shim.js
1 // Based on:
2 // http://norbertlindenberg.com/2012/05/ecmascript-supplementary-characters/
3 // and:
4 // https://github.com/mathiasbynens/String.fromCodePoint/blob/master
5 // /fromcodepoint.js
6
7 'use strict';
8
9 var floor = Math.floor, fromCharCode = String.fromCharCode;
10
11 module.exports = function (codePoint/*, â€¦codePoints*/) {
12         var chars = [], l = arguments.length, i, c, result = '';
13         for (i = 0; i < l; ++i) {
14                 c = Number(arguments[i]);
15                 if (!isFinite(c) || c < 0 || c > 0x10FFFF || floor(c) !== c) {
16                         throw new RangeError("Invalid code point " + c);
17                 }
18
19                 if (c < 0x10000) {
20                         chars.push(c);
21                 } else {
22                         c -= 0x10000;
23                         chars.push((c >> 10) + 0xD800, (c % 0x400) + 0xDC00);
24                 }
25                 if (i + 1 !== l && chars.length <= 0x4000) continue;
26                 result += fromCharCode.apply(null, chars);
27                 chars.length = 0;
28         }
29         return result;
30 };