kopia lustrzana https://github.com/backface/turtlestitch
support newer unicode functions in Snap!
rodzic
a8b13d829f
commit
1b4bf22d94
12
threads.js
12
threads.js
|
@ -2688,12 +2688,20 @@ Process.prototype.reportStringSize = function (data) {
|
|||
};
|
||||
|
||||
Process.prototype.reportUnicode = function (string) {
|
||||
var str = (string || '').toString()[0];
|
||||
return str ? str.charCodeAt(0) : 0;
|
||||
var str = (string || '\u0000').toString()[0];
|
||||
|
||||
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.
|
||||
String.fromCodePoint(code);
|
||||
}
|
||||
return String.fromCharCode(code);
|
||||
};
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue