mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
lib: add URI handling functions to primordials
PR-URL: https://github.com/nodejs/node/pull/37394 Reviewed-By: Zijian Liu <lxxyxzj@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
1 parent
a4dd50f8f9
commit
af39df6d03
6 files changed
+21
No files matched your search
@@ -38,6 +38,10 @@ rules:
|
||||
- name: Boolean
|
||||
- name: DataView
|
||||
- name: Date
|
||||
- name: decodeURI
|
||||
- name: decodeURIComponent
|
||||
- name: encodeURI
|
||||
- name: encodeURIComponent
|
||||
- name: Error
|
||||
ignore:
|
||||
- prepareStackTrace
|
||||
|
||||
@@ -107,6 +107,10 @@ const {
|
||||
WeakMapPrototype,
|
||||
WeakSet,
|
||||
WeakSetPrototype,
|
||||
decodeURI,
|
||||
decodeURIComponent,
|
||||
encodeURI,
|
||||
encodeURIComponent,
|
||||
} = primordials;
|
||||
|
||||
module.exports = function() {
|
||||
|
||||
@@ -173,6 +173,16 @@ primordials.SafeWeakSet = makeSafe(
|
||||
}
|
||||
);
|
||||
|
||||
// Create copies of URI handling functions
|
||||
[
|
||||
decodeURI,
|
||||
decodeURIComponent,
|
||||
encodeURI,
|
||||
encodeURIComponent,
|
||||
].forEach((fn) => {
|
||||
primordials[fn.name] = fn;
|
||||
});
|
||||
|
||||
// Create copies of the namespace objects
|
||||
[
|
||||
'JSON',
|
||||
|
||||
@@ -30,6 +30,7 @@ const {
|
||||
Symbol,
|
||||
SymbolIterator,
|
||||
SymbolToStringTag,
|
||||
decodeURIComponent,
|
||||
} = primordials;
|
||||
|
||||
const { inspect } = require('internal/util/inspect');
|
||||
|
||||
@@ -34,6 +34,7 @@ const {
|
||||
String,
|
||||
StringPrototypeCharCodeAt,
|
||||
StringPrototypeSlice,
|
||||
decodeURIComponent,
|
||||
} = primordials;
|
||||
|
||||
const { Buffer } = require('buffer');
|
||||
|
||||
@@ -27,6 +27,7 @@ const {
|
||||
ObjectKeys,
|
||||
SafeSet,
|
||||
StringPrototypeCharCodeAt,
|
||||
decodeURIComponent,
|
||||
} = primordials;
|
||||
|
||||
const { toASCII } = require('internal/idna');
|
||||
|
||||
Reference in new issue
Block a user