From ebbc897b69f906d88a99768a2fff7661e2894670 Mon Sep 17 00:00:00 2001 From: Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com> Date: Fri, 15 Mar 2024 17:24:13 -0700 Subject: fix(ext/node): Reimplement StringDecoder to match node's behavior (#22933) Fixes #22158. Basically reimplements the whole `StringDecoder` with a much more direct translation (read like one-to-one) of node's current logic. The old implementation was closer to node's super old impl and it was too hard to keep the code structure while matching the behavior of their new logic. This adds support for UTF-16LE, ascii, and latin1. This also enables the node_compat test, which now passes without modification. --- tools/node_compat/TODO.md | 1 - 1 file changed, 1 deletion(-) (limited to 'tools/node_compat') diff --git a/tools/node_compat/TODO.md b/tools/node_compat/TODO.md index 88cadfc1c..3d8306988 100644 --- a/tools/node_compat/TODO.md +++ b/tools/node_compat/TODO.md @@ -2184,7 +2184,6 @@ NOTE: This file should not be manually edited. Please edit `tests/node_compat/co - [parallel/test-stream3-pipeline-async-iterator.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stream3-pipeline-async-iterator.js) - [parallel/test-string-decoder-end.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-string-decoder-end.js) - [parallel/test-string-decoder-fuzz.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-string-decoder-fuzz.js) -- [parallel/test-string-decoder.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-string-decoder.js) - [parallel/test-stringbytes-external.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-stringbytes-external.js) - [parallel/test-structuredClone-global.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-structuredClone-global.js) - [parallel/test-sync-fileread.js](https://github.com/nodejs/node/tree/v18.12.1/test/parallel/test-sync-fileread.js) -- cgit v1.2.3