immu icon indicating copy to clipboard operation
immu copied to clipboard

Errors Not Thrown on Array.Push

Open andrewjmead opened this issue 8 years ago • 6 comments

First, thanks for the library. I love that it throws error so I can watch my tests fail.

I'm having an issue with the following snippet:

var arr = immu([])
arr.push('one'); // Does not throw an error (array does not update)

var obj = immu({});
obj.key = 'val'; // Throws an error (object does not update)

Trying to mutate an object runs as expected. The object does not get updated and an error is thrown.

Trying to mutate an array doesn't update the array, but it doesn't throw an error.

Is this expected behavior? Thanks!

andrewjmead avatar Mar 30 '16 21:03 andrewjmead