Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

process: remove process.assert #55035

Merged
merged 1 commit into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

Loading