Re: [webkit-dev] !!Tests for equality comparison

2017-04-28 Thread Olmstead, Don
I was looking at clang-tidy and include-what-you-need support in CMake. Clang currently won’t compile WebKit on Windows but I was going to look into that as well so those tools could end up running. Happy to provide some patches if it bears fruit. From: webkit-dev

Re: [webkit-dev] !!Tests for equality comparison

2017-04-28 Thread Maciej Stachowiak
Sent from my iPhone > On Apr 28, 2017, at 1:00 PM, JF Bastien wrote: > > >> On Apr 28, 2017, at 12:12, Maciej Stachowiak wrote: >> >> >> Here's some comments in the other direction: >> >> - If there are times we recommend x != 0 instead of !x, it

Re: [webkit-dev] !!Tests for equality comparison

2017-04-28 Thread JF Bastien
> On Apr 28, 2017, at 12:12, Maciej Stachowiak wrote: > > > Here's some comments in the other direction: > > - If there are times we recommend x != 0 instead of !x, it should maybe be > based on whether the condition is better expressed as "not zero" or "false". > In the

Re: [webkit-dev] !!Tests for equality comparison

2017-04-28 Thread Alex Christensen
I think we should definitely keep !pointerValue instead of pointerValue == nullptr for brevity and it makes sense to think “there’s not a pointer” when there is a pointer to null. I appreciate the reminder that pointers and integers are the same thing at the assembly level when I write

Re: [webkit-dev] !!Tests for equality comparison

2017-04-28 Thread Maciej Stachowiak
I think allowing both forms is worse than mandating one form. It's true that in different situations one or the other may read better, but it's distracting to have differences that are matters of author taste rather than conveying meaningful information. "This is a numeric check, not a boolean

Re: [webkit-dev] !!Tests for equality comparison

2017-04-28 Thread Maciej Stachowiak
Here's some comments in the other direction: - If there are times we recommend x != 0 instead of !x, it should maybe be based on whether the condition is better expressed as "not zero" or "false". In the numTestsForEqualityComparison, that's clearly a "not zero" check given the naming of the

Re: [webkit-dev] Exporting WPT tests

2017-04-28 Thread youenn fablet
Hi Mike, Thanks for the information. It is really great to see Safari be integrated in the bots :) https://cs.chromium.org/chromium/src/third_party/WebKit/Tools/Scripts/webkitpy/w3c/wpt_github.py seems like a really good potential candidate for WPT upstream. y Le ven. 28 avr. 2017 à 08:25,

Re: [webkit-dev] !!Tests for equality comparison

2017-04-28 Thread Chris Dumez
> On Apr 28, 2017, at 8:10 AM, Geoffrey Garen wrote: > > Tests for numeric values where 0 indicates falsiness or emptiness should also > use if (x) / if (!x). > >If (!collection.size()) >return; I think if (collection.isEmpty()) looks even better :) -- 

Re: [webkit-dev] Exporting WPT tests

2017-04-28 Thread Mike Pennisi
Hi Youenn. My name is Mike, and I've been working with Google for the past 4 months or so to improve various aspects of the Web Platform Tests project (more on that here [1]). > The only constraint I know of is that the test does not give flaky tests from > WPT Chrome/Firefox bots. The full

Re: [webkit-dev] !!Tests for equality comparison

2017-04-28 Thread Geoffrey Garen
> but == should be used for testing things where 0 is just another number, like > indexes: > > if (index == 0) >… The index case is especially annoying because we use -1 to indicate notFound, so !index means “the first valid index” rather than “no index”. It’s pretty odd to think of false

Re: [webkit-dev] !!Tests for equality comparison

2017-04-28 Thread Antti Koivisto
This is a good change as long as we are just relaxing the rule rather than mandating ==. I think ! makes a lot of sense when testing for emptiness: if (!container.size()) ... if (!count) ... but == should be used for testing things where 0 is just another number, like indexes: if (index

Re: [webkit-dev] !!Tests for equality comparison

2017-04-28 Thread Keith Miller
Is there any opposition to relaxing this rule? Speak now or forever hold your piece! (not really but I would be curious to hear opposition). Cheers, Keith > On Apr 27, 2017, at 10:32 PM, Carlos Garcia Campos > wrote: > > El jue, 27-04-2017 a las 16:06 -0700, JF Bastien