Skip to content

Fix/4614 textdecoder fatal#4639

Open
Jayant-kernel wants to merge 1 commit intoboa-dev:mainfrom
Jayant-kernel:fix/4614-textdecoder-fatal
Open

Fix/4614 textdecoder fatal#4639
Jayant-kernel wants to merge 1 commit intoboa-dev:mainfrom
Jayant-kernel:fix/4614-textdecoder-fatal

Conversation

@Jayant-kernel
Copy link
Contributor

This PR implements the fatal option for TextDecoder as per the specification.

Changes

  • Updated TextDecoder to store the fatal flag.
  • Updated TextDecoder constructor to parse the fatal option.
  • Implemented strict decoding logic in utf8, utf16le, and utf16be decoders.
    • When fatal is true, invalid byte sequences now throw a TypeError instead of inserting the replacement character (U+FFFD).

Tests

  • Added test cases in core/runtime/src/text/tests.rs verifying fatal: true behavior.
  • Restored the roundtrip test case.

Fixes #4614

@Jayant-kernel Jayant-kernel force-pushed the fix/4614-textdecoder-fatal branch from 30b63af to 5f0481e Compare February 20, 2026 08:53
@github-actions
Copy link

Test262 conformance changes

Test result main count PR count difference
Total 52,862 52,862 0
Passed 49,472 49,472 0
Ignored 2,249 2,249 0
Failed 1,141 1,141 0
Panics 0 0 0
Conformance 93.59% 93.59% 0.00%

@Jayant-kernel
Copy link
Contributor Author

@ChALkeR
please review my pr when free.

@jedel1043
Copy link
Member

This might have to be rebased against #4631, since it touches much of the same things and that PR is about to be merged.

@nekevss nekevss requested a review from a team February 24, 2026 02:31
@nekevss nekevss added the runtime Issues and PRs related to Boa's runtime features label Feb 24, 2026
@jedel1043 jedel1043 added enhancement New feature or request waiting-on-author Waiting on PR changes from the author labels Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request runtime Issues and PRs related to Boa's runtime features waiting-on-author Waiting on PR changes from the author

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fatal option is ignored in TextDecoder

3 participants