diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2022-05-17 07:58:50 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2022-05-17 07:58:50 -0400 |
| commit | 538519547253074bbbf582a6ea7b5b9bcbd65820 (patch) | |
| tree | 53e4f88d76cc0a3f6a6986b30aad1a3093c30024 /docs/bqn.js | |
| parent | ac45cbece949d515509ede6b7c08db8884269245 (diff) | |
Fix JS comparison of characters with one versus two UTF-16 units
Diffstat (limited to 'docs/bqn.js')
| -rw-r--r-- | docs/bqn.js | 2 |
1 files changed, 1 insertions, 1 deletions
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; |
