From 538519547253074bbbf582a6ea7b5b9bcbd65820 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Tue, 17 May 2022 07:58:50 -0400 Subject: Fix JS comparison of characters with one versus two UTF-16 units --- docs/bqn.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/bqn.js b/docs/bqn.js index a0403b69..79e510bc 100644 --- a/docs/bqn.js +++ b/docs/bqn.js @@ -279,7 +279,7 @@ let lesseq = (x,w) => { let s=typeof w, t=typeof x; if (s==="function"||t==="function") throw Error("𝕨≤𝕩: Cannot compare operations"); if (w.ns||x.ns) throw Error("𝕨≤𝕩: Cannot compare namespaces"); - return +(s!==t ? s<=t : w<=x); + return +(s!==t ? s<=t : s==="string" ? w.codePointAt(0)<=x.codePointAt(0) : w<=x); } let equals = (x,w) => { let a,b; -- cgit v1.2.3