-
Notifications
You must be signed in to change notification settings - Fork 7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
_.set creates arrays when sees integres in paths (and this weird behaviour isn't documented) #1685
Comments
Hi @mik01aj! In v4 (due in Jan) we've added |
@jdalton slightly related on the topic of array setting |
Ya, that's been brought up a couple times. I've been avoiding it because tips things it complicates things a bit more. |
@megawac I think you could do this with |
Oh snao! |
Sure, but I'm just anticipating this to be a common request |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I just spent almost an hour debugging this.
When I run this in Node, it hangs and then crashes. When I run this in browser, it works fine.
The problem is that when
_.set
sees an integer in path, it creates an array, and when Node'sconsole.log
sees thatobj.collection.length
is 1170798507, it hangs and then crashes saying "FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory".I can understand that this behaviour is usually convenient, but in situations like this it can cause major pain. I'd actually expect
_.set
to always create plain objects, but creating arrays would also be fine for me as long as it's documented.The text was updated successfully, but these errors were encountered: