mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 12:20:27 +01:00
lib: add URI handling functions to primordials
PR-URL: https://github.com/nodejs/node/pull/37394 Backport-PR-URL: https://github.com/nodejs/node/pull/37859 Reviewed-By: Zijian Liu <lxxyxzj@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
93dd799a86
commit
2da24ac302
|
|
@ -106,6 +106,16 @@ primordials.SafePromise = makeSafe(
|
|||
class SafePromise extends Promise {}
|
||||
);
|
||||
|
||||
// Create copies of URI handling functions
|
||||
[
|
||||
decodeURI,
|
||||
decodeURIComponent,
|
||||
encodeURI,
|
||||
encodeURIComponent,
|
||||
].forEach((fn) => {
|
||||
primordials[fn.name] = fn;
|
||||
});
|
||||
|
||||
// Create copies of the namespace objects
|
||||
[
|
||||
'JSON',
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ const {
|
|||
Symbol,
|
||||
SymbolIterator,
|
||||
SymbolToStringTag,
|
||||
decodeURIComponent,
|
||||
} = primordials;
|
||||
|
||||
const { inspect } = require('internal/util/inspect');
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ const {
|
|||
MathAbs,
|
||||
ObjectCreate,
|
||||
ObjectKeys,
|
||||
decodeURIComponent,
|
||||
} = primordials;
|
||||
|
||||
const { Buffer } = require('buffer');
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ const {
|
|||
ObjectCreate,
|
||||
ObjectKeys,
|
||||
SafeSet,
|
||||
decodeURIComponent,
|
||||
} = primordials;
|
||||
|
||||
const { toASCII } = require('internal/idna');
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user