Re: [w3c/FileAPI] Readonly attributes without setters? (#126)

> So mutable comes first, immutability wrapper is around it. All people are satisfied. Is it clear?

You can't wrap a mutable object in a way to make it immutable. If the "immutable" wrapper really just wraps the underlying mutable object, it is still possible for that underlying mutable object to be mutated. As you demonstrated, the other way around there are no such limitations. You can perfectly wrap a immutable object into a mutable one. Also because of the immutability of blobs and files, creating new ones from other ones is a fairly inexpensive operation (although I would skip the slice, just pass the existing blob/file directly to the constructor of the new one).

So I don't see us making any changes here. Blobs and Files are conceptually immutable objects. If you want mutability you can create your own wrappers on top. As anne said, if you can point to widely used libraries that add such a wrapper that might make us reevaluate the use for one, but for now I don't see any reason to add that to this spec.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/FileAPI/issues/126#issuecomment-480930550

Received on Monday, 8 April 2019 17:38:19 UTC