Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add decodeURIComponent error handling tests for invalid UTF-8 sequences (Fixes #4413) #4414

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ayuan0828
Copy link

This PR adds comprehensive test coverage for decodeURIComponent URIError handling as required by ECMA-262. The tests verify proper error throwing behavior for several types of invalid UTF-8 sequences documented, including:

  1. Surrogate pair violations​ (%ED%BF%BF)
    Tests reserved code points (U+D800-DFFF) per

  2. Overlong encodings​ (%C0%AF)
    Verifies rejection of non-minimal-length encodings

  3. Invalid continuation bytes​ (%ED%7F%BF)
    Checks for missing 10xxxxxx continuation patterns

  4. Incomplete sequences​ (%ED%BF)
    Tests truncated 3-byte sequences

  5. Out-of-range codepoints​ (%F4%90%80%80)
    Validates rejection of codepoints > U+10FFFF

Resolves #4413 by implementing the test case requirements outlined in the issue discussion.

@ayuan0828 ayuan0828 requested a review from a team as a code owner March 4, 2025 03:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

decodeURIComponent should throw URIError for malformed surrogate sequence %ED%BF%BF
1 participant