aboutsummaryrefslogtreecommitdiff
path: root/ext/js/data/sandbox
diff options
context:
space:
mode:
Diffstat (limited to 'ext/js/data/sandbox')
-rw-r--r--ext/js/data/sandbox/string-util.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/js/data/sandbox/string-util.js b/ext/js/data/sandbox/string-util.js
index 096ecffe..3d810ffb 100644
--- a/ext/js/data/sandbox/string-util.js
+++ b/ext/js/data/sandbox/string-util.js
@@ -35,10 +35,10 @@ export class StringUtil {
result += char;
if (++position >= textLength) { break; }
const charCode = char.charCodeAt(0);
- if (charCode >= 0xd800 && charCode < 0xdc00) {
+ if (charCode >= 0xd800 && charCode < 0xdc00) { // charCode is a high surrogate code
const char2 = text[position];
const charCode2 = char2.charCodeAt(0);
- if (charCode2 >= 0xdc00 && charCode2 < 0xe000) {
+ if (charCode2 >= 0xdc00 && charCode2 < 0xe000) { // charCode2 is a low surrogate code
result += char2;
if (++position >= textLength) { break; }
}
@@ -61,10 +61,10 @@ export class StringUtil {
result = char + result;
if (--position < 0) { break; }
const charCode = char.charCodeAt(0);
- if (charCode >= 0xdc00 && charCode < 0xe000) {
+ if (charCode >= 0xdc00 && charCode < 0xe000) { // charCode is a low surrogate code
const char2 = text[position];
const charCode2 = char2.charCodeAt(0);
- if (charCode2 >= 0xd800 && charCode2 < 0xdc00) {
+ if (charCode2 >= 0xd800 && charCode2 < 0xdc00) { // charCode2 is a high surrogate code
result = char2 + result;
if (--position < 0) { break; }
}