o0101 / good.html

💎 Good.HTML. A nice framework without the bad stuff. Lots of custom elements, and nice templates. Good. HTML
https://o0101.github.io/good.html/
MIT License
21 stars 2 forks source link

fix type checking issue in BANG (e.g cells component) where we can set value to be any random JS value #41

Closed o0101 closed 3 years ago

o0101 commented 3 years ago

After removing the elaborate type checking code for performance, the lack of type checks (we still have some, but not all we did before) allows some values to be passed through our process pipeline that would not have been before.

for instance, in the cells component (and this is the only real place it occurs because normally we don't permit setting arbitrary JS values in templates--the author decides what values to put there, not the user--but in cells the user decides) we can set a cell formula like so

A1: abcdef
A2: =/[a-z]/g
A3: =a1.match(a2)

the value of A3 will be an Array. Not a VVArray (array of components / HTML produced by VV), just an array. In this case of strings.

So what happens is our process code just gets stuck in an endless loop on this. Let's fix this.