Description
Calling Immutable().setIn with an empty path as the first argument causes a stack overflow.
Steps to reproduce
Execute something like Immutable({foo: 'bar'}).setIn([], {foo: 'baz'})
Expected vs actual behavior
A descriptive error should be thrown, but a stack overflow occurs instead.
Suggested fix
function objectSetIn(path, value) {
if (path.length === 0) {
throw new ImmutableError("You called Immutable().setIn with an empty array." +
" At least one property path key must be provided in the array." );
}
This definitely isn't a major issue, I just think it would be nice to cover this potential situation.
Description Calling
Immutable().setIn
with an empty path as the first argument causes a stack overflow.Steps to reproduce Execute something like
Immutable({foo: 'bar'}).setIn([], {foo: 'baz'})
Expected vs actual behavior A descriptive error should be thrown, but a stack overflow occurs instead.
Suggested fix
This definitely isn't a major issue, I just think it would be nice to cover this potential situation.
Thanks!