Skip to content

Commit fc44dc1

Browse files
avivkellertpoisseau
authored andcommitted
process: remove process.assert
PR-URL: nodejs#55035 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
1 parent 857838f commit fc44dc1

File tree

4 files changed

+5
-41
lines changed

4 files changed

+5
-41
lines changed

doc/api/deprecations.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -2142,14 +2142,17 @@ parameter.
21422142

21432143
<!-- YAML
21442144
changes:
2145+
- version: REPLACEME
2146+
pr-url: https://github.com/nodejs/node/pull/55035
2147+
description: End-of-Life.
21452148
- version: v10.0.0
21462149
pr-url: https://github.com/nodejs/node/pull/18666
21472150
description: Runtime deprecation.
21482151
- version: v0.3.7
21492152
description: Documentation-only deprecation.
21502153
-->
21512154

2152-
Type: Runtime
2155+
Type: End-of-Life
21532156

21542157
`process.assert()` is deprecated. Please use the [`assert`][] module instead.
21552158

lib/internal/bootstrap/node.js

+1-10
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,7 @@ const {
6767
} = primordials;
6868
const config = internalBinding('config');
6969
const internalTimers = require('internal/timers');
70-
const {
71-
defineOperation,
72-
deprecate,
73-
} = require('internal/util');
70+
const { defineOperation } = require('internal/util');
7471
const {
7572
validateInteger,
7673
} = require('internal/validators');
@@ -265,12 +262,6 @@ ObjectDefineProperty(process, 'allowedNodeEnvironmentFlags', {
265262
configurable: true,
266263
});
267264

268-
// process.assert
269-
process.assert = deprecate(
270-
perThreadSetup.assert,
271-
'process.assert() is deprecated. Please use the `assert` module instead.',
272-
'DEP0100');
273-
274265
// TODO(joyeecheung): this property has not been well-maintained, should we
275266
// deprecate it in favor of a better API?
276267
const { isDebugBuild, hasOpenSSL, hasInspector } = config;

lib/internal/process/per_thread.js

-5
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ const {
3333
const {
3434
ErrnoException,
3535
codes: {
36-
ERR_ASSERTION,
3736
ERR_INVALID_ARG_TYPE,
3837
ERR_INVALID_ARG_VALUE,
3938
ERR_OUT_OF_RANGE,
@@ -53,9 +52,6 @@ let getValidatedPath; // We need to lazy load it because of the circular depende
5352

5453
const kInternal = Symbol('internal properties');
5554

56-
function assert(x, msg) {
57-
if (!x) throw new ERR_ASSERTION(msg || 'assertion error');
58-
}
5955
const { exitCodes: { kNoFailure } } = internalBinding('errors');
6056

6157
const binding = internalBinding('process_methods');
@@ -428,7 +424,6 @@ const { arch, platform, version } = process;
428424

429425
module.exports = {
430426
toggleTraceCategoryState,
431-
assert,
432427
buildAllowedFlags,
433428
wrapProcessMethods,
434429
hrtime,

test/parallel/test-process-assert.js

-25
This file was deleted.

0 commit comments

Comments
 (0)