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

Surplus parameters should be ignored #581

Closed
Implementist opened this issue Jun 26, 2019 · 1 comment
Closed

Surplus parameters should be ignored #581

Implementist opened this issue Jun 26, 2019 · 1 comment

Comments

@Implementist
Copy link

Implementist commented Jun 26, 2019

According to ES standard 5.1 Chapter 15.5.4.11, String.prototype.replace(searchValue, replaceValue) should be called with two parameters and surplus parameters should be ignored.

The testcase is:

var func = function (argument) {
    return argument.replace("NonCommercial", "NCpattern", "($28,");
};
var Parameter0 = ";W.b[V";
func(Parameter0);

The output is:

js: uncaught JavaScript runtime exception: SyntaxError: invalid flag after regular expression

This error shows with version 1.7.11.

@rbri
Copy link
Collaborator

rbri commented Jul 20, 2019

Made a fix for this.

@gbrail gbrail closed this as completed in 68671c4 Jul 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants