BUG: angular.merge breaks some objects #15180
Description
I believe this is a bug. The angular merge function will break some objects. I found this issue because of another plugin called Angular-Chart. This plugin build charts (with the use of chartjs) in the angular way.
I posted the issue there, but in depth i believe this is an angular bug.
because the object generated with ctx.createLinearGradient function will be merged like it is an object, but should be treaded as value.
If you want to know the whole issue, you can find it here:
jtblin/angular-chart.js#510
Shortly, the merge function should check if the item is a normal object or a special object to deside if going deeper or just putting the object like a value it the target is the correct way.
bellow how jquery does this check
var normalObject = {};
var gradient = ctx.createLinearGradient(0, 0, 250, 0);
typeof normalObject -> "object"
typeof gradient -> "object"
toString.call(normalObject) -> "[object Object]"
toString.call(gradient) -> "[object CanvasGradient]"
if more info is needed, please let me know