repl: eol deprecate instantiating without new

PR-URL: https://github.com/nodejs/node/pull/59495
Refs: https://github.com/nodejs/node/pull/54869
Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit is contained in:
Aviv Keller 2025-09-07 15:08:39 -04:00 committed by GitHub
parent f855cda2a2
commit e1d4d6ab49
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 860 additions and 890 deletions

View File

@ -3850,6 +3850,9 @@ It is recommended to use the `new` qualifier instead. This applies to all Zlib c
<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/59495
description: End-of-Life.
- version: v24.0.0
pr-url: https://github.com/nodejs/node/pull/54869
description: Runtime deprecation.
@ -3860,10 +3863,10 @@ changes:
description: Documentation-only deprecation.
-->
Type: Runtime
Type: End-of-Life
Instantiating classes without the `new` qualifier exported by the `node:repl` module is deprecated.
It is recommended to use the `new` qualifier instead. This applies to all REPL classes, including
The `new` qualifier must be used instead. This applies to all REPL classes, including
`REPLServer` and `Recoverable`.
<!-- md-lint skip-deprecation DEP0186 -->

File diff suppressed because it is too large Load Diff

View File

@ -1050,17 +1050,3 @@ function event(ee, expected) {
}));
});
}
{
const server = repl.REPLServer();
common.expectWarning({
DeprecationWarning: {
DEP0185: 'Instantiating REPLServer without the \'new\' keyword has been deprecated.',
// For the 'url.format' test-case.
DEP0169:
'`url.parse()` behavior is not standardized and prone to errors that have security implications. ' +
'Use the WHATWG URL API instead. CVEs are not issued for `url.parse()` vulnerabilities.',
}
});
server.emit('line', '.exit');
}