Skip to content

repl cannot handle single quote in regex, when within a function #5113

@phillipwei

Description

@phillipwei

I'm getting a 'SyntaxError: Unexpected end of input' when I try to enter the following in the repl

var someFunction = function(s) {
    s = s.replace(/'/g, '');
}

However, s = s.replace(/'/g, '') by itself on a new line is OK. Am I doing something wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-bugIssues with confirmed bugs.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