From 90189dd9974be01596ec776e63a4eceef1a036e0 Mon Sep 17 00:00:00 2001 From: Kenta Moriuchi Date: Tue, 7 Nov 2023 06:18:28 +0900 Subject: fix(ext): use `String#toWellFormed` in ext/webidl and ext/node (#21054) Fixes #18802 This PR adds `util.toUSVString` to node:util: ```js import util from "node:util"; util.toUSVString("string\ud801"); // => "string\ufffd" ``` --- cli/tests/node_compat/test/parallel/test-util.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'cli/tests/node_compat/test/parallel/test-util.js') diff --git a/cli/tests/node_compat/test/parallel/test-util.js b/cli/tests/node_compat/test/parallel/test-util.js index 5d1ed9b30..eaffc7f6d 100644 --- a/cli/tests/node_compat/test/parallel/test-util.js +++ b/cli/tests/node_compat/test/parallel/test-util.js @@ -161,8 +161,7 @@ assert.strictEqual(util.isFunction(function() {}), true); assert.strictEqual(util.isFunction(), false); assert.strictEqual(util.isFunction('string'), false); -// TODO(wafuwafu13): Enable this when `toUSVString` is ready. -// assert.strictEqual(util.toUSVString('string\ud801'), 'string\ufffd'); +assert.strictEqual(util.toUSVString('string\ud801'), 'string\ufffd'); { assert.strictEqual(util.types.isNativeError(new Error()), true); -- cgit v1.2.3