mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
lib: move GLOBAL and root aliases to EOL
GLOBAL and root have been long deprecated. PR-URL: https://github.com/nodejs/node/pull/31167 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
This commit is contained in:
@@ -404,6 +404,9 @@ The [`fs.readSync()`][] legacy `String` interface is deprecated. Use the
|
||||
### DEP0016: `GLOBAL`/`root`
|
||||
<!-- YAML
|
||||
changes:
|
||||
- version: REPLACEME
|
||||
pr-url: REPLACEME
|
||||
description: End-of-Life
|
||||
- version: v6.12.0
|
||||
pr-url: https://github.com/nodejs/node/pull/10116
|
||||
description: A deprecation code has been assigned.
|
||||
@@ -412,10 +415,10 @@ changes:
|
||||
description: Runtime deprecation.
|
||||
-->
|
||||
|
||||
Type: Runtime
|
||||
Type: End-of-Life
|
||||
|
||||
The `GLOBAL` and `root` aliases for the `global` property are deprecated
|
||||
and should no longer be used.
|
||||
The `GLOBAL` and `root` aliases for the `global` property were deprecated
|
||||
in Node.js 6.0.0 and have since been removed.
|
||||
|
||||
<a id="DEP0017"></a>
|
||||
### DEP0017: `Intl.v8BreakIterator`
|
||||
|
||||
@@ -40,7 +40,6 @@ setupPrepareStackTrace();
|
||||
|
||||
const {
|
||||
JSONParse,
|
||||
ObjectDefineProperties,
|
||||
ObjectDefineProperty,
|
||||
ObjectGetPrototypeOf,
|
||||
ObjectSetPrototypeOf,
|
||||
@@ -294,36 +293,6 @@ function setupGlobalProxy() {
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
function makeGetter(name) {
|
||||
return deprecate(function() {
|
||||
return this;
|
||||
}, `'${name}' is deprecated, use 'global'`, 'DEP0016');
|
||||
}
|
||||
|
||||
function makeSetter(name) {
|
||||
return deprecate(function(value) {
|
||||
ObjectDefineProperty(this, name, {
|
||||
configurable: true,
|
||||
writable: true,
|
||||
enumerable: true,
|
||||
value: value
|
||||
});
|
||||
}, `'${name}' is deprecated, use 'global'`, 'DEP0016');
|
||||
}
|
||||
|
||||
ObjectDefineProperties(global, {
|
||||
GLOBAL: {
|
||||
configurable: true,
|
||||
get: makeGetter('GLOBAL'),
|
||||
set: makeSetter('GLOBAL')
|
||||
},
|
||||
root: {
|
||||
configurable: true,
|
||||
get: makeGetter('root'),
|
||||
set: makeSetter('root')
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function setupBuffer() {
|
||||
|
||||
@@ -2532,24 +2532,23 @@ assert.strictEqual(
|
||||
'unescape', 'eval', 'isFinite',
|
||||
'isNaN', 'SharedArrayBuffer', 'Atomics',
|
||||
'globalThis', 'WebAssembly', 'global',
|
||||
'process', 'GLOBAL', 'root',
|
||||
'Buffer', 'URL', 'URLSearchParams',
|
||||
'TextEncoder', 'TextDecoder', 'clearInterval',
|
||||
'clearTimeout', 'setInterval', 'setTimeout',
|
||||
'queueMicrotask', 'clearImmediate', 'setImmediate',
|
||||
'module', 'require', 'assert',
|
||||
'async_hooks', 'buffer', 'child_process',
|
||||
'cluster', 'crypto', 'dgram',
|
||||
'dns', 'domain', 'events',
|
||||
'fs', 'http', 'http2',
|
||||
'https', 'inspector', 'net',
|
||||
'os', 'path', 'perf_hooks',
|
||||
'punycode', 'querystring', 'readline',
|
||||
'repl', 'stream', 'string_decoder',
|
||||
'tls', 'trace_events', 'tty',
|
||||
'url', 'v8', 'vm',
|
||||
'worker_threads', 'zlib', '_',
|
||||
'_error', 'util'
|
||||
'process', 'Buffer', 'URL',
|
||||
'URLSearchParams', 'TextEncoder', 'TextDecoder',
|
||||
'clearInterval', 'clearTimeout', 'setInterval',
|
||||
'setTimeout', 'queueMicrotask', 'clearImmediate',
|
||||
'setImmediate', 'module', 'require',
|
||||
'assert', 'async_hooks', 'buffer',
|
||||
'child_process', 'cluster', 'crypto',
|
||||
'dgram', 'dns', 'domain',
|
||||
'events', 'fs', 'http',
|
||||
'http2', 'https', 'inspector',
|
||||
'net', 'os', 'path',
|
||||
'perf_hooks', 'punycode', 'querystring',
|
||||
'readline', 'repl', 'stream',
|
||||
'string_decoder', 'tls', 'trace_events',
|
||||
'tty', 'url', 'v8',
|
||||
'vm', 'worker_threads', 'zlib',
|
||||
'_', '_error', 'util'
|
||||
];
|
||||
|
||||
out = util.inspect(
|
||||
@@ -2558,44 +2557,43 @@ assert.strictEqual(
|
||||
);
|
||||
expected = [
|
||||
'[',
|
||||
" 'Object', 'Function', 'Array',",
|
||||
" 'Number', 'parseFloat', 'parseInt',",
|
||||
" 'Infinity', 'NaN', 'undefined',",
|
||||
" 'Boolean', 'String', 'Symbol',",
|
||||
" 'Date', 'Promise', 'RegExp',",
|
||||
" 'Error', 'EvalError', 'RangeError',",
|
||||
" 'ReferenceError', 'SyntaxError', 'TypeError',",
|
||||
" 'URIError', 'JSON', 'Math',",
|
||||
" 'console', 'Intl', 'ArrayBuffer',",
|
||||
" 'Uint8Array', 'Int8Array', 'Uint16Array',",
|
||||
" 'Int16Array', 'Uint32Array', 'Int32Array',",
|
||||
" 'Float32Array', 'Float64Array', 'Uint8ClampedArray',",
|
||||
" 'BigUint64Array', 'BigInt64Array', 'DataView',",
|
||||
" 'Map', 'BigInt', 'Set',",
|
||||
" 'WeakMap', 'WeakSet', 'Proxy',",
|
||||
" 'Reflect', 'decodeURI', 'decodeURIComponent',",
|
||||
" 'encodeURI', 'encodeURIComponent', 'escape',",
|
||||
" 'unescape', 'eval', 'isFinite',",
|
||||
" 'isNaN', 'SharedArrayBuffer', 'Atomics',",
|
||||
" 'globalThis', 'WebAssembly', 'global',",
|
||||
" 'process', 'GLOBAL', 'root',",
|
||||
" 'Buffer', 'URL', 'URLSearchParams',",
|
||||
" 'TextEncoder', 'TextDecoder', 'clearInterval',",
|
||||
" 'clearTimeout', 'setInterval', 'setTimeout',",
|
||||
" 'queueMicrotask', 'clearImmediate', 'setImmediate',",
|
||||
" 'module', 'require', 'assert',",
|
||||
" 'async_hooks', 'buffer', 'child_process',",
|
||||
" 'cluster', 'crypto', 'dgram',",
|
||||
" 'dns', 'domain', 'events',",
|
||||
" 'fs', 'http', 'http2',",
|
||||
" 'https', 'inspector', 'net',",
|
||||
" 'os', 'path', 'perf_hooks',",
|
||||
" 'punycode', 'querystring', 'readline',",
|
||||
" 'repl', 'stream', 'string_decoder',",
|
||||
" 'tls', 'trace_events', 'tty',",
|
||||
" 'url', 'v8', 'vm',",
|
||||
" 'worker_threads', 'zlib', '_',",
|
||||
" '_error', 'util'",
|
||||
" 'Object', 'Function', 'Array',",
|
||||
" 'Number', 'parseFloat', 'parseInt',",
|
||||
" 'Infinity', 'NaN', 'undefined',",
|
||||
" 'Boolean', 'String', 'Symbol',",
|
||||
" 'Date', 'Promise', 'RegExp',",
|
||||
" 'Error', 'EvalError', 'RangeError',",
|
||||
" 'ReferenceError', 'SyntaxError', 'TypeError',",
|
||||
" 'URIError', 'JSON', 'Math',",
|
||||
" 'console', 'Intl', 'ArrayBuffer',",
|
||||
" 'Uint8Array', 'Int8Array', 'Uint16Array',",
|
||||
" 'Int16Array', 'Uint32Array', 'Int32Array',",
|
||||
" 'Float32Array', 'Float64Array', 'Uint8ClampedArray',",
|
||||
" 'BigUint64Array', 'BigInt64Array', 'DataView',",
|
||||
" 'Map', 'BigInt', 'Set',",
|
||||
" 'WeakMap', 'WeakSet', 'Proxy',",
|
||||
" 'Reflect', 'decodeURI', 'decodeURIComponent',",
|
||||
" 'encodeURI', 'encodeURIComponent', 'escape',",
|
||||
" 'unescape', 'eval', 'isFinite',",
|
||||
" 'isNaN', 'SharedArrayBuffer', 'Atomics',",
|
||||
" 'globalThis', 'WebAssembly', 'global',",
|
||||
" 'process', 'Buffer', 'URL',",
|
||||
" 'URLSearchParams', 'TextEncoder', 'TextDecoder',",
|
||||
" 'clearInterval', 'clearTimeout', 'setInterval',",
|
||||
" 'setTimeout', 'queueMicrotask', 'clearImmediate',",
|
||||
" 'setImmediate', 'module', 'require',",
|
||||
" 'assert', 'async_hooks', 'buffer',",
|
||||
" 'child_process', 'cluster', 'crypto',",
|
||||
" 'dgram', 'dns', 'domain',",
|
||||
" 'events', 'fs', 'http',",
|
||||
" 'http2', 'https', 'inspector',",
|
||||
" 'net', 'os', 'path',",
|
||||
" 'perf_hooks', 'punycode', 'querystring',",
|
||||
" 'readline', 'repl', 'stream',",
|
||||
" 'string_decoder', 'tls', 'trace_events',",
|
||||
" 'tty', 'url', 'v8',",
|
||||
" 'vm', 'worker_threads', 'zlib',",
|
||||
" '_', '_error', 'util'",
|
||||
']'
|
||||
].join('\n');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user