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:
parent
7ac904e5d2
commit
4562697feb
@ -189,7 +189,9 @@ if (!config.noBrowserGlobals) {
|
|||||||
// https://url.spec.whatwg.org/#urlsearchparams
|
// https://url.spec.whatwg.org/#urlsearchparams
|
||||||
exposeInterface(global, 'URLSearchParams', URLSearchParams);
|
exposeInterface(global, 'URLSearchParams', URLSearchParams);
|
||||||
|
|
||||||
const { TextEncoder, TextDecoder } = NativeModule.require('util');
|
const {
|
||||||
|
TextEncoder, TextDecoder
|
||||||
|
} = NativeModule.require('internal/encoding');
|
||||||
// https://encoding.spec.whatwg.org/#textencoder
|
// https://encoding.spec.whatwg.org/#textencoder
|
||||||
exposeInterface(global, 'TextEncoder', TextEncoder);
|
exposeInterface(global, 'TextEncoder', TextEncoder);
|
||||||
// https://encoding.spec.whatwg.org/#textdecoder
|
// https://encoding.spec.whatwg.org/#textdecoder
|
||||||
|
Loading…
x
Reference in New Issue
Block a user