3 ms·
> I wonder why they don't just do `.toString()` on the mapping function and then parse the resulting Javascript into an AST and figure out property accesses fro
by kentonv 1y ago
> I wonder why they don't just do `.toString()` on the mapping function and then parse the resulting Javascript into an AST and figure out property accesses from that.
That sounds incredibly complicated, and not something we could do in a <10kB library!
- actionfromafar 1y agoMaybe Fabrice Bellard could spare an afternoon.
- sonthonax 1y agoTo the contrary, a simple expression language is one of those things that can easily be done in that size.
- kentonv 1y agoBut the suggestion wasn't to design a simple expression language. The suggestion was to parse _JavaScript_. (That's what `.toString()` on a function does... gives you back the JavaScript.)