Re: In WebIDL, should having a .prototype on interface objects be optional?

Travis Leithead:
> I guess you'd check for URL.href then? Or try { new URL("/test"); } catch (ex) { console.log("not supported"); }

I agree with Travis, you should be checking the particular features you 
want to use, rather than checking the existence of the prototype as a 
proxy for that test.

If URL.prototype was required to exist, you could just do ("href" in 
URL.prototype).  Since it currently doesn't, you could do ("href" in 
(URL.prototype || {})).

Received on Friday, 28 September 2012 23:15:07 UTC