This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2012-December/038362.html Maybe syntax like: attribute FileList? set (FileList? or sequence<Blob>) files; would work.
Feels ugly to me. Reminds me of PutForwards.
(In reply to comment #1) > Feels ugly to me. Reminds me of PutForwards. Is it the syntax or the feature that you find ugly? If it's the syntax, we can certainly bikeshed it, e.g.: attribute FileList?/(FileList? or sequence<Blob>) files; and many other variants. But I don't think that we can dodge the fact that the feature itself represents a genuine need.
(In reply to comment #1) > Feels ugly to me. I think one not ugly way would be to have one super-type and all types used in the getter/setter use this super-type. But retrofitting a super-type after things are already deployed on the web doesn't feel like realistic.
(In reply to comment #2) > Is it the syntax or the feature that you find ugly? The feature. You set property to [ objectOfTypeA ], yet you get back [ objectOfTypeB ].
We already do type conversion, I don't really see how this is different.
This would not be conversion, but creating new objects from the data passed to setter.
(In reply to comment #6) > This would not be conversion, but creating new objects from the > data passed to setter. I believe Anne means that a setFoo/getFoo pair, where setFoo accepts a wider variety of things but getFoo returns a specific type, is already possible, acceptable, and widely used. Thus, why is it unacceptable to do the same with an attribute?
It's even done with attributes, e.g. anywhere we use PutForwards. This just seem like a variant on that.
Exactly. As I said in comment 1, reminds me of PutForwards. And some people think (I'm certainly not the only one) that use of PutForwards is bad API design.
If [PutForwards] is bad, I would say it is due to it being not obvious what the actual property being changed is, not because it has asymmetric get/set types.