Tweaked restrict mode and blog post: Seems like restrict mode found us a jQuery bug

Skip to first unread message

Olov Lassus

Jun 16, 2011, 6:53:24 PM6/16/11
to JSShaper
I'll update the rules and try restrict mode sections on <> shortly. Here's a copy and paste from the blog post for now:

I removed the restrict mode custom versions of == and !=. This shouldn’t come as a big surprise since I hinted that I wasn’t happy with clause 1 in the case for restrict mode <>. Now all of ==, !=, === and !== behave identically in normal and restrict mode and you should strongly consider not using == and != irrespective of whether you use restrict mode or not.

I relaxed the restrict mode + operator slightly. It was previously only allowed for str + str (concatenation) or num + num (addition), but never a mix. It’s now also allowed for num + str or str + num, which happens to be the most common coercing usage of it out there in the wild. I hope that this will lower the barrier of restrict mode adoption.


Reply all
Reply to author
0 new messages