镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

ECMAScript: Unicode dot must consume WTF-8 surrogate pairs atomically #12

Closed

Description

@chrisbbreuer

Discovered by zig-utils/zig-js#213.

With .unicode = true, . currently uses the byte-NFA code-point automaton and accepts a WTF-8 encoded high surrogate as a complete one-unit match. ECMAScript Unicode matching must combine an adjacent high/low surrogate pair and consume both UTF-16 code units atomically.

Acceptance criteria:

  • Unicode . consumes a WTF-8 high/low surrogate pair as one match.
  • Legacy non-Unicode . continues consuming only one surrogate code unit.
  • Unicode . continues matching normal UTF-8 scalar input and respecting dot-all/line terminators.
  • Add a focused regression test suitable for zig-js private JSC ABI reuse.

Activity

  1. chrisbbreuer commented on Jul 17, 2026

    @chrisbbreuer
    MemberAuthor

    Implemented and pushed to main in 86159c5. Unicode dot now routes through the ECMAScript code-point matcher so adjacent WTF-8 high/low surrogates are consumed atomically; legacy dot remains one UTF-16 unit. Focused regression passed (1/1).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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