Skip to content

Commit

Permalink
process: remove process.assert
Browse files Browse the repository at this point in the history
  • Loading branch information
RedYetiDev committed Sep 20, 2024
1 parent 8b8fc53 commit c7b180f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 41 deletions.
5 changes: 4 additions & 1 deletion doc/api/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -2142,14 +2142,17 @@ parameter.

<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/55035
description: End-of-Life.
- version: v10.0.0
pr-url: https://github.com/nodejs/node/pull/18666
description: Runtime deprecation.
- version: v0.3.7
description: Documentation-only deprecation.
-->

Type: Runtime
Type: End-of-Life

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

Expand Down
11 changes: 1 addition & 10 deletions lib/internal/bootstrap/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,7 @@ const {
} = primordials;
const config = internalBinding('config');
const internalTimers = require('internal/timers');
const {
defineOperation,
deprecate,
} = require('internal/util');
const { defineOperation } = require('internal/util');
const {
validateInteger,
} = require('internal/validators');
Expand Down Expand Up @@ -265,12 +262,6 @@ ObjectDefineProperty(process, 'allowedNodeEnvironmentFlags', {
configurable: true,
});

// process.assert
process.assert = deprecate(
perThreadSetup.assert,
'process.assert() is deprecated. Please use the `assert` module instead.',
'DEP0100');

// TODO(joyeecheung): this property has not been well-maintained, should we
// deprecate it in favor of a better API?
const { isDebugBuild, hasOpenSSL, hasInspector } = config;
Expand Down
5 changes: 0 additions & 5 deletions lib/internal/process/per_thread.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ const {
const {
ErrnoException,
codes: {
ERR_ASSERTION,
ERR_INVALID_ARG_TYPE,
ERR_INVALID_ARG_VALUE,
ERR_OUT_OF_RANGE,
Expand All @@ -53,9 +52,6 @@ let getValidatedPath; // We need to lazy load it because of the circular depende

const kInternal = Symbol('internal properties');

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

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

module.exports = {
toggleTraceCategoryState,
assert,
buildAllowedFlags,
wrapProcessMethods,
hrtime,
Expand Down
25 changes: 0 additions & 25 deletions test/parallel/test-process-assert.js

This file was deleted.

0 comments on commit c7b180f

Please sign in to comment.