unconed / mathbox

Presentation-quality WebGL math graphing
MIT License
1.33k stars 109 forks source link

Missing equals sign in code #71

Open 0tickpulse opened 1 month ago

0tickpulse commented 1 month ago

I had an issue with mathbox in my website, and I managed to trace it down to this line over here:

const l = (target.length = size ? size : value.length);

It seems like there might have been a mistake in the code, where a = was used instead of == or ===. I beliebe this is the reason behind the issue in my website: Cannot assign to read only property 'length' of string 'xyz'

- const l = (target.length = size ? size : value.length);
+ const l = (target.length === size ? size : value.length);
ChristopherChudzicki commented 1 month ago

Hi @0tickpulse ! Thanks for this. That does definitely seem like a bug.

Just to help me verify that this fixes the issue you experienced, could you describe the issue you encountered, or provide the code for a reproduction? You're also welcome to make a PR to fix this issue.

0tickpulse commented 1 month ago

I made a stackblitz that reproduces my issue, it occurs when I try to set the eulerOrder: https://stackblitz.com/edit/stackblitz-starters-afxwth?file=index.html