Skip to content

Double chaining leads to a stack overflow #2853

Open
@jgonggrijp

Description

@jgonggrijp

The following expression is useless, since you'd expect the second chain call to just return a new wrapper of the same value:

_.chain([1]).chain()

but rather than behaving like a no-op, it results in a stack overflow. Credits to @reubenrybnik for pointing this out in DefinitelyTyped/DefinitelyTyped#45201 (comment). This minor pitfall might have been introduced with #1691.

I'm hesitant to give this a "bug" label as it is rather non-urgent, but technically it's a bug. Documenting in an issue ticket for reference.

Metadata

Metadata

Assignees

No one assigned

    Labels

    startergood choice for new contributors

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions