Skip to content

this value is lost when iterating via forOwn (Lodash.underscore) #220

@SBoudrias

Description

@SBoudrias

Since v1.1.0, it seems that Lodash created a bug when passing an iteration from forEach to forOwn.

I only tested it with the Lodash.underscore so I can't say if it's limited to this build in particular.

I've been able to fix the bug in the underscore build by changing line 745 by this one using call to keep the this value:

if (callback.call(thisArg, iterable[index], index, collection) === indicatorObject) return result;

I'd send a pull request, but I'm not sure how this all work with the build and the system. I hope this helps a little.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions