From b77e68b86df1bfba47582d6fc3a8815e2b06f811 Mon Sep 17 00:00:00 2001 From: Sora Morimoto Date: Fri, 20 Sep 2024 05:29:35 +0900 Subject: [PATCH] runtime: fix noSubstr Signed-off-by: Sora Morimoto --- biome.json | 1 + runtime/mlBytes.js | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/biome.json b/biome.json index 4e1d7e8c0e..524a89bd51 100644 --- a/biome.json +++ b/biome.json @@ -23,6 +23,7 @@ "noSwitchDeclarations": "off" }, "nursery": { + "noSubstr": "error", "noUselessEscapeInRegex": "error" }, "security": { diff --git a/runtime/mlBytes.js b/runtime/mlBytes.js index 577616952d..faf242546b 100644 --- a/runtime/mlBytes.js +++ b/runtime/mlBytes.js @@ -89,7 +89,6 @@ function caml_utf8_of_utf16(s) { if (c < 0x80) { for (var j = i + 1; j < l && (c = s.charCodeAt(j)) < 0x80; j++); if (j - i > 512) { - t.substr(0, 1); b += t; t = ""; b += s.slice(i, j); @@ -125,7 +124,6 @@ function caml_utf8_of_utf16(s) { ); } if (t.length > 1024) { - t.substr(0, 1); b += t; t = ""; } @@ -140,7 +138,6 @@ function caml_utf16_of_utf8(s) { if (c1 < 0x80) { for (var j = i + 1; j < l && (c1 = s.charCodeAt(j)) < 0x80; j++); if (j - i > 512) { - t.substr(0, 1); b += t; t = ""; b += s.slice(i, j); @@ -179,7 +176,6 @@ function caml_utf16_of_utf8(s) { t += String.fromCharCode(0xd7c0 + (v >> 10), 0xdc00 + (v & 0x3ff)); else t += String.fromCharCode(v); if (t.length > 1024) { - t.substr(0, 1); b += t; t = ""; }