Tests/LibWeb: Add test that dumps all global JS constructors

This commit is contained in:
Andreas Kling 2024-06-28 14:57:42 +02:00 committed by Andreas Kling
commit a84261ee7a
Notes: sideshowbarker 2024-07-17 11:30:05 +09:00
2 changed files with 389 additions and 0 deletions

View file

@ -0,0 +1,18 @@
<script src="include.js"></script>
<script>
test(() => {
const properties = Object.getOwnPropertyNames(window);
const constructors = properties.filter(prop => {
try {
const value = window[prop];
return typeof value === 'function' && !!value.prototype;
} catch (e) {
return false;
}
});
constructors.sort();
for (const c of constructors)
println(c);
});
</script>