lichess-org / chessground

Mobile/Web chess UI for lichess.org
https://lichess.org
GNU General Public License v3.0
1.02k stars 262 forks source link

Only merge plain objects #230

Closed benediktwerner closed 2 years ago

benediktwerner commented 2 years ago

When merging in a new config, it shouldn't try to deep merge the HTMLElement addDimensionsCssVarsTo (which will throw when trying to assign read-only properties).

ig could just check specifically for HTMLElements or that key but seems better to future proof it and check that it's a reasonably proper plain object.

benediktwerner commented 2 years ago

Actually, ig this means arrays like shapes also won't be merged anymore. But I don't think that was ever desirable anyway? 🤔

Tbh kinda surprised that worked before.

niklasf commented 2 years ago

Looks like a separate cg.setShapes() is used (mostly?)