mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-15 23:09:05 +00:00
Tests/LibWeb: Add test that dumps all global JS constructors
This commit is contained in:
parent
79acb998e1
commit
a84261ee7a
Notes:
sideshowbarker
2024-07-17 11:30:05 +09:00
Author: https://github.com/awesomekling
Commit: a84261ee7a
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/304
Reviewed-by: https://github.com/nico ✅
2 changed files with 389 additions and 0 deletions
18
Tests/LibWeb/Text/input/all-window-properties.html
Normal file
18
Tests/LibWeb/Text/input/all-window-properties.html
Normal 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>
|
Loading…
Add table
Add a link
Reference in a new issue