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

An issue about String.prototype.substr of Rhino. #670

Closed
NWU-NISL opened this issue May 16, 2020 · 1 comment · Fixed by #671
Closed

An issue about String.prototype.substr of Rhino. #670

NWU-NISL opened this issue May 16, 2020 · 1 comment · Fixed by #671

Comments

@NWU-NISL
Copy link

Testcase

var a = '123'.substr(1, undefined);
print(a);

Expect Output

'23'

Rhino Actual Output

''

Other JS Engines Output

'23'

Rhino Version

1.7.12 & 1.7.11

ECMA Script Standard

In ES Standard( 5.1/6/10), it says:

The substr method takes two arguments, start and length, and returns a substring of the result of converting the this object to a String, starting from character position start and running for length characters (or through the end of the String if length is undefined).

I think this is a implementation bug of rhino.

Looking forward to your reply, thanks! 😆

@rbri rbri mentioned this issue May 16, 2020
@NWU-NISL
Copy link
Author

@rbri Nice job!
Closed.

gbrail pushed a commit that referenced this issue May 19, 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

Successfully merging a pull request may close this issue.

1 participant