From 4562697feb85a3c73d31d9f4d857bae7d24d7846 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Sat, 9 Mar 2019 16:35:43 +0100 Subject: [PATCH] lib: import TextEncoder and TextDecoder from `internal/encoding` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/26547 Refs: https://github.com/nodejs/node/issues/26546 Reviewed-By: Michaƫl Zasso Reviewed-By: Ruben Bridgewater Reviewed-By: James M Snell --- lib/internal/bootstrap/node.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js index 86c4bfd6544ed6..840bb6b785ebf7 100644 --- a/lib/internal/bootstrap/node.js +++ b/lib/internal/bootstrap/node.js @@ -189,7 +189,9 @@ if (!config.noBrowserGlobals) { // https://url.spec.whatwg.org/#urlsearchparams exposeInterface(global, 'URLSearchParams', URLSearchParams); - const { TextEncoder, TextDecoder } = NativeModule.require('util'); + const { + TextEncoder, TextDecoder + } = NativeModule.require('internal/encoding'); // https://encoding.spec.whatwg.org/#textencoder exposeInterface(global, 'TextEncoder', TextEncoder); // https://encoding.spec.whatwg.org/#textdecoder