mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
lib: add legacy built-in functions to primordials
PR-URL: https://github.com/nodejs/node/pull/42049 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Mestery <mestery@protonmail.com>
This commit is contained in:
1 parent
a4969d5c37
commit
f7ea75fd0a
3 files changed
+15
No files matched your search
@@ -138,6 +138,8 @@ rules:
|
||||
- name: decodeURIComponent
|
||||
- name: encodeURI
|
||||
- name: encodeURIComponent
|
||||
- name: escape
|
||||
- name: eval
|
||||
- name: Error
|
||||
ignore:
|
||||
- prepareStackTrace
|
||||
@@ -181,6 +183,7 @@ rules:
|
||||
- name: Uint32Array
|
||||
- name: Uint8Array
|
||||
- name: Uint8ClampedArray
|
||||
- name: unescape
|
||||
- name: URIError
|
||||
- name: WeakMap
|
||||
into: Safe
|
||||
|
||||
@@ -121,7 +121,9 @@ const {
|
||||
decodeURIComponent,
|
||||
encodeURI,
|
||||
encodeURIComponent,
|
||||
escape,
|
||||
globalThis,
|
||||
unescape,
|
||||
} = primordials;
|
||||
|
||||
const {
|
||||
@@ -232,6 +234,7 @@ module.exports = function() {
|
||||
|
||||
// 19 The Global Object
|
||||
// 19.2 Function Properties of the Global Object
|
||||
// eslint-disable-next-line node-core/prefer-primordials
|
||||
eval,
|
||||
// eslint-disable-next-line node-core/prefer-primordials
|
||||
isFinite,
|
||||
|
||||
@@ -154,6 +154,15 @@ function copyPrototype(src, dest, prefix) {
|
||||
primordials[fn.name] = fn;
|
||||
});
|
||||
|
||||
// Create copies of legacy functions
|
||||
[
|
||||
escape,
|
||||
eval,
|
||||
unescape,
|
||||
].forEach((fn) => {
|
||||
primordials[fn.name] = fn;
|
||||
});
|
||||
|
||||
// Create copies of the namespace objects
|
||||
[
|
||||
'JSON',
|
||||
|
||||
Reference in new issue
Block a user