Operator overloading for non-value objects

Anne van Kesteren annevk at annevk.nl
Wed Jan 15 01:50:39 PST 2014

On Wed, Jan 15, 2014 at 7:35 AM, Sebastian Markbåge
<sebastian at calyptus.eu> wrote:
> At risk of derailing the conversation with a tangent... I don't understand
> the premise. Why is it so important that URLs are mutable? (Other than
> already being drafted that way.)

That's a good question. I mostly took after <a> / Location and what
existing URL libraries offered, and nobody has questioned that design
much to date. It is implemented now in Firefox/Chrome though.

URLSearchParams is mutable and that's definitely desired. So if we
still want to expose equivalent functionality we'd have to provide a
readonly variant of that.

We could at some point provide a URLValue API maybe for immutable URLs
(and have operator overloading).


More information about the es-discuss mailing list