Skip to content
This repository was archived by the owner on Feb 26, 2025. It is now read-only.
This repository was archived by the owner on Feb 26, 2025. It is now read-only.

longer-or-code-unit-less-than is not a total order #181

@hiroshige-g

Description

@hiroshige-g

The order used to sort scope keys etc., i.e.
https://wicg.github.io/import-maps/#longer-or-code-unit-less-than

if a’s length is greater than b’s length, or if a is code unit less than b.

is not a total order. For example,

  • "A" is longer-or-code-unit-less-than "AAA"
  • "AAA" is longer-or-code-unit-less-than "A"

Probably this should be something like

if a’s length is greater than b’s length, or if a’s length is equal to b’s length and a is code unit less than b.

or simply

if b is code unit less than a.

Probably the latter one is better, because it's simple to understand and implement.
I'll create a PR shortly.

(Memo: code unit less than also seems to have a spec bug)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions