Skip to content

Exception message for assert(0) depends on whitespace #30872

Closed
@AndrewFinlay

Description

@AndrewFinlay
  • Version: 10, 12
  • Platform: macOS High Sierra 10.13.6
  • Subsystem: Assert

Under Node 10 and Node 12, generating an exception from an assertion failure returns a different assertion failure message depending on differences in whitespace. It seems that with a certain whitespace configuration we see the Node 8 assertion failure message 0 == true, other configurations will generate the Node 10 message The expression evaluated to a falsy value. This issue only seems to affect the exception message, all other behaviour seems consistent.

This will affect anything that runs minified source.

I have included a simple reproduction of the issue here

Metadata

Metadata

Assignees

No one assigned

    Labels

    assertIssues and PRs related to the assert subsystem.confirmed-bugIssues with confirmed bugs.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions