W3C home > Mailing lists > Public > public-script-coord@w3.org > April to June 2014

RE: Fetch API

From: Domenic Denicola <domenic@domenicdenicola.com>
Date: Sun, 1 Jun 2014 23:08:19 +0000
To: Tab Atkins Jr. <jackalmage@gmail.com>
CC: Anne van Kesteren <annevk@annevk.nl>, public-script-coord <public-script-coord@w3.org>, Joshua Bell <jsbell@chromium.org>, Jungkee Song <jungkee.song@samsung.com>, Yehuda Katz <wycats@gmail.com>, Alex Russell <slightlyoff@google.com>, Jonas Sicking <jonas@sicking.cc>, Jake Archibald <jaffathecake@gmail.com>, Tobie Langel <tobie.langel@gmail.com>, WebApps WG <public-webapps@w3.org>
Message-ID: <08b2a609127c4ceca97923353c3a3a9d@BN1PR05MB325.namprd05.prod.outlook.com>
From: Tab Atkins Jr. [mailto:jackalmage@gmail.com] 

> Out of curiosity, would you be okay with it if it was just an override?  That is, if "new Response(...)" took either set of arguments for the ... part?  It sounds like you would be.

Yeah, I mean, I think in this case it would be kind of awkward for clarity, but from a JS language perspective it's perfectly fine.

> This is identically a problem with the case I gave, as Bar.prototype.constructor would be Foo, not Bar.  It's possible that this is still a problem, it's just not unique to named constructors.
^_^

Since `Foo === Bar` in your case, it's not really a problem.

> Since you suggested a static method, that suggests you're fine with
Response.Redirect(http://example.com) giving a new Response object, right?  It's just the fact that RedirectResponse has a .prototype pointing to Response.prototype that gives you pause?

Yeah exactly. (Although it should be lowercase since it's a factory, not a constructor.)

> Presumably RedirectResponse being a subtype would also be acceptable, as its .prototype.constructor would be RedirectResponse?

Yeah, although I'm not sure there's a need to override any functionality here, so not sure that there's a need for subclassing.

Received on Sunday, 1 June 2014 23:08:55 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:21 UTC