On 2015-05-12 05:05, Sukyoung Ryu wrote:
We've noticed that a bug we reported on Jan 28, 2014 and got fixed right away
as follows:
http://meta.wikimedia.org/w/index.php?title=MediaWiki%3AGadget-wm-portal.js&type=revision&diff=7268382&oldid=7164177
revived recently as follows:
http://meta.wikimedia.org/w/index.php?title=MediaWiki%3AGadget-wm-portal.js&type=revision&diff=10643039&oldid=10643032
Could you kindly let us know the reason?
Hi Sukyoung,
Since the fix was originally put in, we made an effort to clean up the
page's JavaScript code in part using the JSHint tool. [1] JSHint flags
uses of JavaScript's == operator, suggesting === instead. I blindly
followed that suggestion without noticing that the left-hand expression
was a call to String.prototype.match(), which either returns null or an
array.
It turns out the former code had been working because ['foo'] == 'foo'
in JavaScript. I've been coding in JavaScript for years and was totally
unaware of that behavior -- more reason to use === instead of ==. I
fixed the code in a way that is unlikely to regress in the future.
Thank you for re-reporting the bug! Please report any future bugs you
find to the portals' talk page [2].
[1] http://jshint.com/
[2] https://meta.wikimedia.org/wiki/Talk:Project_portals
--
Minh Nguyen <m...@1ec5.org>
Jabber: m...@1ec5.org; Blog: http://notes.1ec5.org/
_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l