Skip to content

Check .length before accessing characters #11460

@gaearon

Description

@gaearon

See comment here: #11457 (comment).

Although it seems very unlikely that someone would pass a one-character prop, the price (at least in versions of V8 in Chrome right now) is reported to be about 10x.

So we should check .length first and then do the comparison.

Please comment if you want to take this issue.
If somebody already commented, please let them finish it.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions