Skip to content

Wrong error report message for expression {}) #46877

@tuannd89

Description

@tuannd89

Version

v19.7.0

Platform

No response

Subsystem

No response

What steps will reproduce the bug?

$ node
> {})
({}))
    ^
Uncaught SyntaxError: Unexpected token ')'

How often does it reproduce? Is there a required condition?

Always

What is the expected behavior?

> {})
{})
    ^
Uncaught SyntaxError: Unexpected token ')'

What do you see instead?

> {})
({}))
    ^
Uncaught SyntaxError: Unexpected token ')'

Additional information

We got similar result with expression {}]

Metadata

Metadata

Assignees

No one assigned

    Labels

    replIssues and PRs related to the REPL subsystem.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions