W3C home > Mailing lists > Public > public-script-coord@w3.org > July to September 2015

Re: URL and host comparison methods

From: Anne van Kesteren <annevk@annevk.nl>
Date: Wed, 19 Aug 2015 08:51:26 +0200
Message-ID: <CADnb78g+zPZvLFkENeyNer5HqGNQxaoRLxJsWHLbBFaGrC3w+Q@mail.gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: public-script-coord <public-script-coord@w3.org>
On Tue, Aug 18, 2015 at 11:25 PM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
> Foo.isFoo() is idiomatically used as an instance tester.  That's not
> quite URL.is(), but it's close enough that it might be good to use
> different names.

I was basing this on Object.is() and the lack of a Host object made me
go for URL.hostIs() since we store other methods for hosts there too.


> Why not .matches() and .hostMatches()?  You're *comparing* two urls, after all.

We use matches() on instances, not as statics on classes. That does
not work well for hosts and I'm not sure I would want to force folks
to create a URL instance in order to compare a string as URL.


-- 
https://annevankesteren.nl/
Received on Wednesday, 19 August 2015 06:51:50 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 19 August 2015 06:51:51 UTC