You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
FileList fails to enumerate with console.log #37993
which just tries to obtain each property on the File/Blob object. Since there are no properties defined on the object (only on the prototype), we serialize it as {}. This is exactly the problem that the current implementation of console.log attempts to avoid, since DOM objects generally have more interesting properties on their prototype and JSON.stringify shows those.
Activity
yezhizhen commentedon Jul 11, 2025
[-]`FileList` has empty print with `console.log`[/-][+]`FileList` fails to enumerate with `console.log`[/+]jdm commentedon Jul 11, 2025
This behaviour comes from
servo/components/script/dom/console.rs
Line 284 in 2366a8b
yezhizhen commentedon Jul 11, 2025
Does #37992 also relies on this?
jdm commentedon Jul 11, 2025
It doesn't call the same code; returning a FileList with webdriver goes through
servo/components/script/webdriver_handlers.rs
Lines 419 to 434 in b713347
jdm commentedon Jul 11, 2025
Actually that's incorrect; File/Blob don't have a toJSON, so we fall through to
servo/components/script/webdriver_handlers.rs
Lines 445 to 491 in b713347
{}. This is exactly the problem that the current implementation of console.log attempts to avoid, since DOM objects generally have more interesting properties on their prototype and JSON.stringify shows those.jdm commentedon Jul 11, 2025
https://w3c.github.io/webdriver/#dfn-clone-an-object says
For each enumerable property in value, run the following substeps:, and I don't have a good sense for whether that's supposed to only be own properties or all properties.jdm commentedon Jul 11, 2025
You can try changing
servo/components/script/webdriver_handlers.rs
Line 280 in 3421185
0and see what happens!yezhizhen commentedon Jul 12, 2025
I don't think I can work on this before middle of next week. Anyone is welcome to try :D