Re: [whatwg/url] Define URL's toJSON() (#229)

bzbarsky commented on this pull request.



> @@ -2483,6 +2483,8 @@ interface URL {
            attribute USVString search;
   [SameObject] readonly attribute URLSearchParams searchParams;
            attribute USVString hash;
+
+  USVString toJSON();

Is the question one of having `serializer;` basically be a thing that produces a then-custom-defined toJSON, kinda like `stringifier;`?

The problem is that unlike `stringifier;`, where the return value is clear, the return value of toJSON could be all sorts of things.  We could define `serializer;` to induce the equivalent of `any toJSON();` but that's more annoying to work with than being able to usefully declare your return type...

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/url/pull/229

Received on Thursday, 2 February 2017 17:36:42 UTC