From c43e5b3f190a81bb8753f9822dcbf1a623701da1 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 060593084ce27c..aeb330966c42e4 100644 --- a/lib/internal/bootstrap/node.js +++ b/lib/internal/bootstrap/node.js @@ -192,7 +192,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