Merge pull request #1914 from cycomachead/new-unicode

Improve Unicode Blocks for Some Emoji
upd4.2
Jens Mönig 2018-01-19 14:58:28 +01:00 zatwierdzone przez GitHub
commit 2019f0a0d1
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 10 dodań i 2 usunięć

Wyświetl plik

@ -2690,12 +2690,20 @@ Process.prototype.reportStringSize = function (data) {
};
Process.prototype.reportUnicode = function (string) {
var str = (string || '').toString()[0];
return str ? str.charCodeAt(0) : 0;
var str = isNil(string) ? '\u0000' : string.toString();
if (str.codePointAt) { // support for Unicode in newer browsers.
return str.codePointAt(0);
}
return str.charCodeAt(0);
};
Process.prototype.reportUnicodeAsLetter = function (num) {
var code = +(num || 0);
if (String.fromCodePoint) { // support for Unicode in newer browsers.
return String.fromCodePoint(code);
}
return String.fromCharCode(code);
};