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

9 views
Skip to first unread message

Olov Lassus

unread,
Jun 16, 2011, 6:53:24 PM6/16/11
to JSShaper
I'll update the rules and try restrict mode sections on <http://restrictmode.org> 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 <http://blog.lassus.se/2011/03/case-for-restrict-mode.html>. 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.

http://blog.lassus.se/2011/06/seems-like-restrict-mode-found-us-a-jquery-bug.html

/Olov

Reply all
Reply to author
Forward
0 new messages