Re: [whatwg/url] Consider adding a constructor to make a URL from parts (#354)

The suggested approach does fail for certain properties like `origin`:

```js
String(Object.assign(new URL("https://example.com"), {origin: "https://replace.com"}))
// Uncaught TypeError: Cannot set property origin of [object URL] which has only a getter
```

So back to clumsy string replacement it is, at least for replacing `origin`.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/url/issues/354#issuecomment-1256093908
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/url/issues/354/1256093908@github.com>

Received on Friday, 23 September 2022 11:27:23 UTC