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

A question about String.prototype.search #651

Closed
YiWen-y opened this issue Mar 7, 2020 · 3 comments
Closed

A question about String.prototype.search #651

YiWen-y opened this issue Mar 7, 2020 · 3 comments

Comments

@YiWen-y
Copy link

YiWen-y commented Mar 7, 2020

Revision

rhino-1.7.11

Test case
var NISLFuzzingFunc = function() {
    print(typeof String.prototype.search);
    print(String.prototype.search(1, 1));
};
NISLFuzzingFunc();
Execution steps
java -jar rhino-1.7.11.jar -debug -version 200 testcase.js
Output
function
js: uncaught JavaScript runtime exception: SyntaxError: invalid flag after regular expression
Expected behavior
function
-1
Description

The ES standard does not stipulate a processing method when String.prototype.search has two parameter, but other engines execute normally after ignoring illegal parameters, such as v8, Spider Monkey, and chakra. For rhion, it throw a SyntaxError exception when this happens. Is this a bug about rhino?

@rbri
Copy link
Collaborator

rbri commented May 19, 2020

Will try to let Rhino work like the rest

@rbri
Copy link
Collaborator

rbri commented May 19, 2020

Have added a test case for this - seems to be no longer a problem with the current sources.

gbrail pushed a commit that referenced this issue May 27, 2020
@rbri
Copy link
Collaborator

rbri commented May 28, 2020

Can you please review the test and maybe close this.

@YiWen-y YiWen-y closed this as completed Jun 8, 2020
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