Skip to content

JavaScript debug statements #18851

@BridgeAR

Description

@BridgeAR

I personally would some times like to have some debug calls for internal APIs e.g. the internal errors. It would make the API easier to use by just verifying the input but only when run by our test suite. We are all human and make mistakes. So it should behave similar to a DCHECK in C++ but just in JS. Because I would not want to have those checks run in production.

Do we want to introduce something like that? (Or do we actually already have that and I just missed that?)

I guess there are two ways of implementing something like that:

a) A macro
b) A simple if (env.NODE_DEBUG_INTERNAL === 'true') {}

What do others @nodejs/collaborators think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    metaIssues and PRs related to the general management of the project.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions