Removed GopherJS, basic frontend completed, need backend changes for

torrent storage
This commit is contained in:
2017-11-30 18:12:11 -05:00
parent 67fdef16b1
commit e98ad2cc88
69321 changed files with 5498914 additions and 337 deletions

View File

@@ -0,0 +1,8 @@
"use strict";
if (!require("./is-implemented")()) {
Object.defineProperty(String, "fromCodePoint", { value: require("./shim"),
configurable: true,
enumerable: false,
writable: true });
}

View File

@@ -0,0 +1,5 @@
"use strict";
module.exports = require("./is-implemented")()
? String.fromCodePoint
: require("./shim");

View File

@@ -0,0 +1,7 @@
"use strict";
module.exports = function () {
var fromCodePoint = String.fromCodePoint;
if (typeof fromCodePoint !== "function") return false;
return fromCodePoint(0x1D306, 0x61, 0x1D307) === "\ud834\udf06a\ud834\udf07";
};

View File

@@ -0,0 +1,37 @@
// Based on:
// http://norbertlindenberg.com/2012/05/ecmascript-supplementary-characters/
// and:
// https://github.com/mathiasbynens/String.fromCodePoint/blob/master
// /fromcodepoint.js
"use strict";
var floor = Math.floor, fromCharCode = String.fromCharCode;
// eslint-disable-next-line no-unused-vars
module.exports = function (codePoint1 /*, …codePoints*/) {
var chars = [], length = arguments.length, i, codePoint, result = "";
for (i = 0; i < length; ++i) {
codePoint = Number(arguments[i]);
if (
!isFinite(codePoint) ||
codePoint < 0 ||
codePoint > 0x10ffff ||
floor(codePoint) !== codePoint
) {
throw new RangeError("Invalid code point " + codePoint);
}
if (codePoint < 0x10000) {
chars.push(codePoint);
} else {
codePoint -= 0x10000;
// eslint-disable-next-line no-bitwise
chars.push((codePoint >> 10) + 0xd800, codePoint % 0x400 + 0xdc00);
}
if (i + 1 !== length && chars.length <= 0x4000) continue;
result += fromCharCode.apply(null, chars);
chars.length = 0;
}
return result;
};