LeaVerou / css-almanac

Repo for planning & voting on which stats to study
https://projects.verou.me/mavoice/?repo=leaverou/css-almanac&labels=proposed%20stat
34 stars 3 forks source link

remove unsupported uses of `?.` #51

Closed rviscomi closed 4 years ago

LeaVerou commented 4 years ago

Thanks!

Calling .match() twice does double the work, which may be significant when this runs millions of times.

Also, you cannot rewrite a === b?.c to a === b && b.c. Operator precedence means that this is equivalent to (a === b) && b.c, which is not the same. You need to enforce grouping with parens.

Since time is of the essence, I just pushed a fix for both and I'm gonna go ahead and close this.