kopia lustrzana https://github.com/backface/turtlestitch
commit
2019f0a0d1
12
threads.js
12
threads.js
|
@ -2690,12 +2690,20 @@ Process.prototype.reportStringSize = function (data) {
|
||||||
};
|
};
|
||||||
|
|
||||||
Process.prototype.reportUnicode = function (string) {
|
Process.prototype.reportUnicode = function (string) {
|
||||||
var str = (string || '').toString()[0];
|
var str = isNil(string) ? '\u0000' : string.toString();
|
||||||
return str ? str.charCodeAt(0) : 0;
|
|
||||||
|
if (str.codePointAt) { // support for Unicode in newer browsers.
|
||||||
|
return str.codePointAt(0);
|
||||||
|
}
|
||||||
|
return str.charCodeAt(0);
|
||||||
};
|
};
|
||||||
|
|
||||||
Process.prototype.reportUnicodeAsLetter = function (num) {
|
Process.prototype.reportUnicodeAsLetter = function (num) {
|
||||||
var code = +(num || 0);
|
var code = +(num || 0);
|
||||||
|
|
||||||
|
if (String.fromCodePoint) { // support for Unicode in newer browsers.
|
||||||
|
return String.fromCodePoint(code);
|
||||||
|
}
|
||||||
return String.fromCharCode(code);
|
return String.fromCharCode(code);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue