Skip to content

Cannot slice SliceString with simple range #2

Description

@cloudratha

When slicing a string with a simple start, stop range, it fails to render, throwing a join error.

new SliceString('hello')[[1,3]]; // Fails

Looking at the code, it looks like when a string is sliced without a step, we just call the native slice method. This by default returns a substring of that string, and not an Array.

Later on the instance check tries to join the string, which is an invalid method.

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