Skip to content

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

@NWU-NISL

Description

@NWU-NISL

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! 😆

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions