ylem icon indicating copy to clipboard operation
ylem copied to clipboard

Ylem splices array-like objects passed as props

Open mikedane opened this issue 6 years ago • 1 comments

Small bug in observable-component.js on line 95

canReflect.splice(canKey.get(observable, key), values.index, values.deleteCount, values.insert);

This code seems to be modifying the original prop that was passed instead of replacing it with the new prop. This was initially intended to affect arrays only, and in the case where an array is being passed it should still behave this way. If however, an array-like object is passed this is not the desired behavior as that array-like object may have additional properties of interest to the child which need to be overwritten.

This should be re-written to simply pass the new prop when dealing with an array-like object, and to behave the same when dealing with a normal array.

mikedane avatar Sep 12 '18 18:09 mikedane