lib: import TextEncoder and TextDecoder from internal/encoding

PR-URL: https://github.com/nodejs/node/pull/26547
Refs: https://github.com/nodejs/node/issues/26546
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Joyee Cheung 2019-03-09 16:35:43 +01:00
parent 7ac904e5d2
commit 4562697feb
No known key found for this signature in database
GPG Key ID: 92B78A53C8303B8D

View File

@ -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