Closed whimboo closed 1 year ago
Here an example snippet to replicate the behavior - no properties are returned in each of the browsers:
var file = new File(["foo"], "bar");
Object.getOwnPropertyNames(file);
This PR actually needs some more updates given that there are other failing cases:
seen
check for value
or alternatively even better within clone an object
. But therefore the serialization of collections need to be fixed by not calling clone an object
per entry.toJSON()
could fail with an exception which should be propagated accordingly.@jgraham your feedback would be welcome! I've updated all the different parts of the spec that we agreed on need changes. New tests for the changes will be supplied via https://bugzilla.mozilla.org/show_bug.cgi?id=1794078.
Currently in step 2 of clone an object only the own enumerable properties are taken into account. This actually causes issues with WebIDL interfaces like
File
which won't get thename
property serialized.Interestingly we have a specific wdspec test for a
FileList
case, which requires thename
property serialized. And all browsers are currently passing this test.As such we probably want to remove the restriction for only serializing own properties, and allow to serialize all the enumerable properties. This won't cause a regression and keeps the behavior that is currently shown by browsers.
CC @jgraham, @sadym-chromium, @patrickangle, @gsnedders, @shs96c.
Preview | Diff