From 1321d2eaa066fb4277c2e12c9b9b2de3637e2492 Mon Sep 17 00:00:00 2001 From: Tatsunori Uchino Date: Fri, 20 Dec 2024 00:09:39 +0900 Subject: [PATCH] codePointAt is excessive --- lib/rules_inline/state_inline.mjs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/rules_inline/state_inline.mjs b/lib/rules_inline/state_inline.mjs index d1c00a6..8d33819 100644 --- a/lib/rules_inline/state_inline.mjs +++ b/lib/rules_inline/state_inline.mjs @@ -118,9 +118,8 @@ StateInline.prototype.scanDelims = function (start, canSplitWord) { function getLastCharCode (str, pos) { // treat beginning of the line as a whitespace if (pos <= 0) { return 0x20 } - const charCode = str.codePointAt(pos - 1) + const charCode = str.charCodeAt(pos - 1) // not low surrogates (BMP) - // undefined & 0xFC00 = 0, but never happens thanks to the first if if ((charCode & 0xFC00) !== 0xDC00) { return charCode } // undefined if out of range (leading stray low surrogates)