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 strange testcase about RegExp Object of rhino. #665

Closed
ty5491003 opened this issue May 9, 2020 · 1 comment
Closed

A strange testcase about RegExp Object of rhino. #665

ty5491003 opened this issue May 9, 2020 · 1 comment

Comments

@ty5491003
Copy link

Testcase & Output

testcase1:

var a = new RegExp("1");
print(a(1));

output1:

null

testcase2:

var a = new RegExp("1");
print(a(2));

output2:

1

Other JS Engines Output

TypeError: a is not a function.

Rhino Version

1.7.11

Description

In my opinion, a is an Object, not a function. I don't know why rhino can execute these two testcases without throwing an exception and get two different result? Maybe it's a bug? or a feature?

So I need your help. Looking forward to your reply, thanks!

@ty5491003
Copy link
Author

ty5491003 commented May 20, 2020

Thanks for your work.
Closed.

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

1 participant