RE: Fetch API

From: Tab Atkins Jr. [] 

> 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( 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