On Thu Sep 4 17:44:48 2025 +0000, Jacek Caban wrote:
Please don't use `eval` like this, ideally at all. You could just unquote the string in the first place. Those tests could use more clean up. The whole array is not really needed, you could just use `getOwnPropertyNames` on the prototype. It would be nice to have `test_own_props`-based test in `documentmode.js`. We could then just depend on it doing the right thing here.
Oh I just used eval to be able to obtain its name as well, but I guess I'll just extract it from the toString like in the `prototype props` test in `documentmode.js`. I couldn't use window[prop] either since some of them are nested.
I got rid of the array, but `getOwnPropertyNames` brings its own can of worms, not sure if it's better but here it is. Specifically it has some props that aren't part of the JSON object (e.g. `constructor` and methods but also some internal ones) which I had to skip. But I also wrote tests for the prototype props since we were missing, which also unveils those internal ones in ALL CAPS.
Overall the tests should be way more encompassing now and fixed a couple of broken things.